Files
wgpu/naga/tests/out/spv/interpolate.spvasm
T

352 lines
9.6 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: rspirv
; Bound: 140
OpCapability Shader
OpCapability SampleRateShading
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %31 "vert_main" %11 %13 %15 %16 %17 %19 %21 %23 %24 %25 %26 %27 %28
OpEntryPoint Fragment %138 "frag_main" %109 %112 %115 %117 %119 %122 %125 %128 %130 %132 %134 %136
OpExecutionMode %138 OriginUpperLeft
%3 = OpString "interpolate.wgsl"
OpSource Unknown 0 %3 "//TODO: merge with \"interface\"?
// NOTE: invalid combinations are tested in the
// `validation::incompatible_interpolation_and_sampling_types` test.
struct FragmentInput {
@builtin(position) position: vec4<f32>,
@location(0) @interpolate(flat) _flat : u32,
@location(1) @interpolate(flat, first) flat_first : u32,
@location(2) @interpolate(flat, either) flat_either : u32,
@location(3) @interpolate(linear) _linear : f32,
@location(4) @interpolate(linear, centroid) linear_centroid : vec2<f32>,
@location(6) @interpolate(linear, sample) linear_sample : vec3<f32>,
@location(7) @interpolate(linear, center) linear_center : vec3<f32>,
@location(8) @interpolate(perspective) perspective : vec4<f32>,
@location(9) @interpolate(perspective, centroid) perspective_centroid : f32,
@location(10) @interpolate(perspective, sample) perspective_sample : f32,
@location(11) @interpolate(perspective, center) perspective_center : f32,
}
@vertex
fn vert_main() -> FragmentInput {
var out: FragmentInput;
out.position = vec4<f32>(2.0, 4.0, 5.0, 6.0);
out._flat = 8u;
out.flat_first = 9u;
out.flat_either = 10u;
out._linear = 27.0;
out.linear_centroid = vec2<f32>(64.0, 125.0);
out.linear_sample = vec3<f32>(216.0, 343.0, 512.0);
out.linear_center = vec3<f32>(255.0, 511.0, 1024.0);
out.perspective = vec4<f32>(729.0, 1000.0, 1331.0, 1728.0);
out.perspective_centroid = 2197.0;
out.perspective_sample = 2744.0;
out.perspective_center = 2812.0;
return out;
}
@fragment
fn frag_main(val : FragmentInput) { }
"
OpMemberName %9 0 "position"
OpMemberName %9 1 "_flat"
OpMemberName %9 2 "flat_first"
OpMemberName %9 3 "flat_either"
OpMemberName %9 4 "_linear"
OpMemberName %9 5 "linear_centroid"
OpMemberName %9 6 "linear_sample"
OpMemberName %9 7 "linear_center"
OpMemberName %9 8 "perspective"
OpMemberName %9 9 "perspective_centroid"
OpMemberName %9 10 "perspective_sample"
OpMemberName %9 11 "perspective_center"
OpName %9 "FragmentInput"
OpName %11 "position"
OpName %13 "_flat"
OpName %15 "flat_first"
OpName %16 "flat_either"
OpName %17 "_linear"
OpName %19 "linear_centroid"
OpName %21 "linear_sample"
OpName %23 "linear_center"
OpName %24 "perspective"
OpName %25 "perspective_centroid"
OpName %26 "perspective_sample"
OpName %27 "perspective_center"
OpName %31 "vert_main"
OpName %61 "out"
OpName %109 "position"
OpName %112 "_flat"
OpName %115 "flat_first"
OpName %117 "flat_either"
OpName %119 "_linear"
OpName %122 "linear_centroid"
OpName %125 "linear_sample"
OpName %128 "linear_center"
OpName %130 "perspective"
OpName %132 "perspective_centroid"
OpName %134 "perspective_sample"
OpName %136 "perspective_center"
OpName %138 "frag_main"
OpMemberDecorate %9 0 Offset 0
OpMemberDecorate %9 1 Offset 16
OpMemberDecorate %9 2 Offset 20
OpMemberDecorate %9 3 Offset 24
OpMemberDecorate %9 4 Offset 28
OpMemberDecorate %9 5 Offset 32
OpMemberDecorate %9 6 Offset 48
OpMemberDecorate %9 7 Offset 64
OpMemberDecorate %9 8 Offset 80
OpMemberDecorate %9 9 Offset 96
OpMemberDecorate %9 10 Offset 100
OpMemberDecorate %9 11 Offset 104
OpDecorate %11 BuiltIn Position
OpDecorate %13 Location 0
OpDecorate %13 Flat
OpDecorate %15 Location 1
OpDecorate %15 Flat
OpDecorate %16 Location 2
OpDecorate %16 Flat
OpDecorate %17 Location 3
OpDecorate %17 NoPerspective
OpDecorate %19 Location 4
OpDecorate %19 NoPerspective
OpDecorate %19 Centroid
OpDecorate %21 Location 6
OpDecorate %21 NoPerspective
OpDecorate %21 Sample
OpDecorate %23 Location 7
OpDecorate %23 NoPerspective
OpDecorate %24 Location 8
OpDecorate %25 Location 9
OpDecorate %25 Centroid
OpDecorate %26 Location 10
OpDecorate %26 Sample
OpDecorate %27 Location 11
OpDecorate %28 BuiltIn PointSize
OpDecorate %109 BuiltIn FragCoord
OpDecorate %112 Location 0
OpDecorate %112 Flat
OpDecorate %115 Location 1
OpDecorate %115 Flat
OpDecorate %117 Location 2
OpDecorate %117 Flat
OpDecorate %119 Location 3
OpDecorate %119 NoPerspective
OpDecorate %122 Location 4
OpDecorate %122 NoPerspective
OpDecorate %122 Centroid
OpDecorate %125 Location 6
OpDecorate %125 NoPerspective
OpDecorate %125 Sample
OpDecorate %128 Location 7
OpDecorate %128 NoPerspective
OpDecorate %130 Location 8
OpDecorate %132 Location 9
OpDecorate %132 Centroid
OpDecorate %134 Location 10
OpDecorate %134 Sample
OpDecorate %136 Location 11
%2 = OpTypeVoid
%4 = OpTypeFloat 32
%5 = OpTypeVector %4 4
%6 = OpTypeInt 32 0
%7 = OpTypeVector %4 2
%8 = OpTypeVector %4 3
%9 = OpTypeStruct %5 %6 %6 %6 %4 %7 %8 %8 %5 %4 %4 %4
%12 = OpTypePointer Output %5
%11 = OpVariable %12 Output
%14 = OpTypePointer Output %6
%13 = OpVariable %14 Output
%15 = OpVariable %14 Output
%16 = OpVariable %14 Output
%18 = OpTypePointer Output %4
%17 = OpVariable %18 Output
%20 = OpTypePointer Output %7
%19 = OpVariable %20 Output
%22 = OpTypePointer Output %8
%21 = OpVariable %22 Output
%23 = OpVariable %22 Output
%24 = OpVariable %12 Output
%25 = OpVariable %18 Output
%26 = OpVariable %18 Output
%27 = OpVariable %18 Output
%29 = OpTypePointer Output %4
%28 = OpVariable %29 Output
%30 = OpConstant %4 1.0
%32 = OpTypeFunction %2
%33 = OpConstant %4 2.0
%34 = OpConstant %4 4.0
%35 = OpConstant %4 5.0
%36 = OpConstant %4 6.0
%37 = OpConstantComposite %5 %33 %34 %35 %36
%38 = OpConstant %6 8
%39 = OpConstant %6 9
%40 = OpConstant %6 10
%41 = OpConstant %4 27.0
%42 = OpConstant %4 64.0
%43 = OpConstant %4 125.0
%44 = OpConstantComposite %7 %42 %43
%45 = OpConstant %4 216.0
%46 = OpConstant %4 343.0
%47 = OpConstant %4 512.0
%48 = OpConstantComposite %8 %45 %46 %47
%49 = OpConstant %4 255.0
%50 = OpConstant %4 511.0
%51 = OpConstant %4 1024.0
%52 = OpConstantComposite %8 %49 %50 %51
%53 = OpConstant %4 729.0
%54 = OpConstant %4 1000.0
%55 = OpConstant %4 1331.0
%56 = OpConstant %4 1728.0
%57 = OpConstantComposite %5 %53 %54 %55 %56
%58 = OpConstant %4 2197.0
%59 = OpConstant %4 2744.0
%60 = OpConstant %4 2812.0
%62 = OpTypePointer Function %9
%63 = OpConstantNull %9
%65 = OpTypePointer Function %5
%66 = OpConstant %6 0
%68 = OpTypePointer Function %6
%69 = OpConstant %6 1
%71 = OpConstant %6 2
%73 = OpConstant %6 3
%75 = OpTypePointer Function %4
%76 = OpConstant %6 4
%78 = OpTypePointer Function %7
%79 = OpConstant %6 5
%81 = OpTypePointer Function %8
%82 = OpConstant %6 6
%84 = OpConstant %6 7
%89 = OpConstant %6 11
%110 = OpTypePointer Input %5
%109 = OpVariable %110 Input
%113 = OpTypePointer Input %6
%112 = OpVariable %113 Input
%115 = OpVariable %113 Input
%117 = OpVariable %113 Input
%120 = OpTypePointer Input %4
%119 = OpVariable %120 Input
%123 = OpTypePointer Input %7
%122 = OpVariable %123 Input
%126 = OpTypePointer Input %8
%125 = OpVariable %126 Input
%128 = OpVariable %126 Input
%130 = OpVariable %110 Input
%132 = OpVariable %120 Input
%134 = OpVariable %120 Input
%136 = OpVariable %120 Input
%31 = OpFunction %2 None %32
%10 = OpLabel
%61 = OpVariable %62 Function %63
OpStore %28 %30
OpBranch %64
%64 = OpLabel
OpLine %3 24 4
OpLine %3 24 19
OpLine %3 24 4
%67 = OpAccessChain %65 %61 %66
OpStore %67 %37
OpLine %3 25 4
OpLine %3 25 4
%70 = OpAccessChain %68 %61 %69
OpStore %70 %38
OpLine %3 26 4
OpLine %3 26 4
%72 = OpAccessChain %68 %61 %71
OpStore %72 %39
OpLine %3 27 4
OpLine %3 27 4
%74 = OpAccessChain %68 %61 %73
OpStore %74 %40
OpLine %3 28 4
OpLine %3 28 4
%77 = OpAccessChain %75 %61 %76
OpStore %77 %41
OpLine %3 29 4
OpLine %3 29 26
OpLine %3 29 4
%80 = OpAccessChain %78 %61 %79
OpStore %80 %44
OpLine %3 30 4
OpLine %3 30 24
OpLine %3 30 4
%83 = OpAccessChain %81 %61 %82
OpStore %83 %48
OpLine %3 31 4
OpLine %3 31 24
OpLine %3 31 4
%85 = OpAccessChain %81 %61 %84
OpStore %85 %52
OpLine %3 32 4
OpLine %3 32 22
OpLine %3 32 4
%86 = OpAccessChain %65 %61 %38
OpStore %86 %57
OpLine %3 33 4
OpLine %3 33 4
%87 = OpAccessChain %75 %61 %39
OpStore %87 %58
OpLine %3 34 4
OpLine %3 34 4
%88 = OpAccessChain %75 %61 %40
OpStore %88 %59
OpLine %3 35 4
OpLine %3 35 4
%90 = OpAccessChain %75 %61 %89
OpStore %90 %60
OpLine %3 1 1
%91 = OpLoad %9 %61
%92 = OpCompositeExtract %5 %91 0
OpStore %11 %92
%93 = OpAccessChain %29 %11 %69
%94 = OpLoad %4 %93
%95 = OpFNegate %4 %94
OpStore %93 %95
%96 = OpCompositeExtract %6 %91 1
OpStore %13 %96
%97 = OpCompositeExtract %6 %91 2
OpStore %15 %97
%98 = OpCompositeExtract %6 %91 3
OpStore %16 %98
%99 = OpCompositeExtract %4 %91 4
OpStore %17 %99
%100 = OpCompositeExtract %7 %91 5
OpStore %19 %100
%101 = OpCompositeExtract %8 %91 6
OpStore %21 %101
%102 = OpCompositeExtract %8 %91 7
OpStore %23 %102
%103 = OpCompositeExtract %5 %91 8
OpStore %24 %103
%104 = OpCompositeExtract %4 %91 9
OpStore %25 %104
%105 = OpCompositeExtract %4 %91 10
OpStore %26 %105
%106 = OpCompositeExtract %4 %91 11
OpStore %27 %106
OpReturn
OpFunctionEnd
%138 = OpFunction %2 None %32
%107 = OpLabel
%111 = OpLoad %5 %109
%114 = OpLoad %6 %112
%116 = OpLoad %6 %115
%118 = OpLoad %6 %117
%121 = OpLoad %4 %119
%124 = OpLoad %7 %122
%127 = OpLoad %8 %125
%129 = OpLoad %8 %128
%131 = OpLoad %5 %130
%133 = OpLoad %4 %132
%135 = OpLoad %4 %134
%137 = OpLoad %4 %136
%108 = OpCompositeConstruct %9 %111 %114 %116 %118 %121 %124 %127 %129 %131 %133 %135 %137
OpBranch %139
%139 = OpLabel
OpReturn
OpFunctionEnd