mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 14:01:08 +01:00
Add a new type, `Input`, representing a particular Naga input file, with methods to generate related paths - output files with a particular extension, parameter files, and the input file itself. Use this throughout `snapshots.rs` to generate paths. Give `Input` utility methods for reading and writing files.
217 lines
4.9 KiB
Plaintext
217 lines
4.9 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.1
|
|
; Generator: rspirv
|
|
; Bound: 95
|
|
OpCapability Shader
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint Vertex %24 "vs_main" %15 %18 %20 %22
|
|
OpEntryPoint Fragment %57 "fs_main" %51 %54 %56
|
|
OpExecutionMode %57 OriginUpperLeft
|
|
%3 = OpString "debug-symbol-simple.wgsl"
|
|
OpSource Unknown 0 %3 "struct VertexInput {
|
|
@location(0) position: vec3<f32>,
|
|
@location(1) color: vec3<f32>,
|
|
};
|
|
|
|
struct VertexOutput {
|
|
@builtin(position) clip_position: vec4<f32>,
|
|
@location(0) color: vec3<f32>,
|
|
};
|
|
|
|
@vertex
|
|
fn vs_main(
|
|
model: VertexInput,
|
|
) -> VertexOutput {
|
|
var out: VertexOutput;
|
|
out.color = model.color;
|
|
out.clip_position = vec4<f32>(model.position, 1.0);
|
|
return out;
|
|
}
|
|
|
|
// Fragment shader
|
|
|
|
@fragment
|
|
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
|
var color = in.color;
|
|
for (var i = 0; i < 10; i += 1) {
|
|
var ii = f32(i);
|
|
color.x += ii*0.001;
|
|
color.y += ii*0.002;
|
|
}
|
|
|
|
return vec4<f32>(color, 1.0);
|
|
}"
|
|
OpMemberName %6 0 "position"
|
|
OpMemberName %6 1 "color"
|
|
OpName %6 "VertexInput"
|
|
OpMemberName %8 0 "clip_position"
|
|
OpMemberName %8 1 "color"
|
|
OpName %8 "VertexOutput"
|
|
OpName %10 "out"
|
|
OpName %15 "position"
|
|
OpName %18 "color"
|
|
OpName %20 "clip_position"
|
|
OpName %22 "color"
|
|
OpName %24 "vs_main"
|
|
OpName %41 "color"
|
|
OpName %43 "i"
|
|
OpName %46 "ii"
|
|
OpName %51 "clip_position"
|
|
OpName %54 "color"
|
|
OpName %57 "fs_main"
|
|
OpMemberDecorate %6 0 Offset 0
|
|
OpMemberDecorate %6 1 Offset 16
|
|
OpMemberDecorate %8 0 Offset 0
|
|
OpMemberDecorate %8 1 Offset 16
|
|
OpDecorate %15 Location 0
|
|
OpDecorate %18 Location 1
|
|
OpDecorate %20 BuiltIn Position
|
|
OpDecorate %22 Location 0
|
|
OpDecorate %51 BuiltIn FragCoord
|
|
OpDecorate %54 Location 0
|
|
OpDecorate %56 Location 0
|
|
%2 = OpTypeVoid
|
|
%5 = OpTypeFloat 32
|
|
%4 = OpTypeVector %5 3
|
|
%6 = OpTypeStruct %4 %4
|
|
%7 = OpTypeVector %5 4
|
|
%8 = OpTypeStruct %7 %4
|
|
%9 = OpTypeInt 32 1
|
|
%11 = OpTypePointer Function %8
|
|
%12 = OpConstantNull %8
|
|
%16 = OpTypePointer Input %4
|
|
%15 = OpVariable %16 Input
|
|
%18 = OpVariable %16 Input
|
|
%21 = OpTypePointer Output %7
|
|
%20 = OpVariable %21 Output
|
|
%23 = OpTypePointer Output %4
|
|
%22 = OpVariable %23 Output
|
|
%25 = OpTypeFunction %2
|
|
%26 = OpConstant %5 1.0
|
|
%28 = OpTypePointer Function %4
|
|
%31 = OpTypeInt 32 0
|
|
%30 = OpConstant %31 1
|
|
%33 = OpTypePointer Function %7
|
|
%36 = OpConstant %31 0
|
|
%42 = OpConstantNull %4
|
|
%44 = OpTypePointer Function %9
|
|
%45 = OpConstantNull %9
|
|
%47 = OpTypePointer Function %5
|
|
%48 = OpConstantNull %5
|
|
%52 = OpTypePointer Input %7
|
|
%51 = OpVariable %52 Input
|
|
%54 = OpVariable %16 Input
|
|
%56 = OpVariable %21 Output
|
|
%58 = OpConstant %9 0
|
|
%59 = OpConstant %9 10
|
|
%60 = OpConstant %5 0.001
|
|
%61 = OpConstant %5 0.002
|
|
%62 = OpConstant %9 1
|
|
%70 = OpTypeBool
|
|
%78 = OpTypePointer Function %5
|
|
%24 = OpFunction %2 None %25
|
|
%13 = OpLabel
|
|
%10 = OpVariable %11 Function %12
|
|
%17 = OpLoad %4 %15
|
|
%19 = OpLoad %4 %18
|
|
%14 = OpCompositeConstruct %6 %17 %19
|
|
OpBranch %27
|
|
%27 = OpLabel
|
|
OpLine %3 16 5
|
|
%29 = OpCompositeExtract %4 %14 1
|
|
OpLine %3 16 5
|
|
%32 = OpAccessChain %28 %10 %30
|
|
OpStore %32 %29
|
|
OpLine %3 17 5
|
|
%34 = OpCompositeExtract %4 %14 0
|
|
OpLine %3 17 25
|
|
%35 = OpCompositeConstruct %7 %34 %26
|
|
OpLine %3 17 5
|
|
%37 = OpAccessChain %33 %10 %36
|
|
OpStore %37 %35
|
|
OpLine %3 1 1
|
|
%38 = OpLoad %8 %10
|
|
%39 = OpCompositeExtract %7 %38 0
|
|
OpStore %20 %39
|
|
%40 = OpCompositeExtract %4 %38 1
|
|
OpStore %22 %40
|
|
OpReturn
|
|
OpFunctionEnd
|
|
%57 = OpFunction %2 None %25
|
|
%49 = OpLabel
|
|
%41 = OpVariable %28 Function %42
|
|
%43 = OpVariable %44 Function %45
|
|
%46 = OpVariable %47 Function %48
|
|
%53 = OpLoad %7 %51
|
|
%55 = OpLoad %4 %54
|
|
%50 = OpCompositeConstruct %8 %53 %55
|
|
OpBranch %63
|
|
%63 = OpLabel
|
|
OpLine %3 25 17
|
|
%64 = OpCompositeExtract %4 %50 1
|
|
OpLine %3 25 5
|
|
OpStore %41 %64
|
|
OpLine %3 26 10
|
|
OpStore %43 %58
|
|
OpBranch %65
|
|
%65 = OpLabel
|
|
OpLine %3 26 5
|
|
OpLoopMerge %66 %68 None
|
|
OpBranch %67
|
|
%67 = OpLabel
|
|
OpLine %3 1 1
|
|
%69 = OpLoad %9 %43
|
|
OpLine %3 26 21
|
|
%71 = OpSLessThan %70 %69 %59
|
|
OpLine %3 26 20
|
|
OpSelectionMerge %72 None
|
|
OpBranchConditional %71 %72 %73
|
|
%73 = OpLabel
|
|
OpBranch %66
|
|
%72 = OpLabel
|
|
OpBranch %74
|
|
%74 = OpLabel
|
|
OpLine %3 27 18
|
|
%76 = OpLoad %9 %43
|
|
%77 = OpConvertSToF %5 %76
|
|
OpLine %3 27 9
|
|
OpStore %46 %77
|
|
OpLine %3 28 9
|
|
%79 = OpLoad %5 %46
|
|
OpLine %3 28 9
|
|
%80 = OpFMul %5 %79 %60
|
|
%81 = OpAccessChain %78 %41 %36
|
|
%82 = OpLoad %5 %81
|
|
%83 = OpFAdd %5 %82 %80
|
|
OpLine %3 28 9
|
|
%84 = OpAccessChain %78 %41 %36
|
|
OpStore %84 %83
|
|
OpLine %3 29 9
|
|
%85 = OpLoad %5 %46
|
|
OpLine %3 29 9
|
|
%86 = OpFMul %5 %85 %61
|
|
%87 = OpAccessChain %78 %41 %30
|
|
%88 = OpLoad %5 %87
|
|
%89 = OpFAdd %5 %88 %86
|
|
OpLine %3 29 9
|
|
%90 = OpAccessChain %78 %41 %30
|
|
OpStore %90 %89
|
|
OpBranch %75
|
|
%75 = OpLabel
|
|
OpBranch %68
|
|
%68 = OpLabel
|
|
OpLine %3 26 29
|
|
%91 = OpLoad %9 %43
|
|
%92 = OpIAdd %9 %91 %62
|
|
OpLine %3 26 29
|
|
OpStore %43 %92
|
|
OpBranch %65
|
|
%66 = OpLabel
|
|
OpLine %3 1 1
|
|
%93 = OpLoad %4 %41
|
|
OpLine %3 32 12
|
|
%94 = OpCompositeConstruct %7 %93 %26
|
|
OpStore %56 %94
|
|
OpReturn
|
|
OpFunctionEnd |