mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 23:41:01 +01:00
Add a new Naga feature, `"compact"`, which adds a new function `naga::compact::compact`, which removes unused expressions, types, and constants from a `Module`.
149 lines
4.0 KiB
Plaintext
149 lines
4.0 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.1
|
|
; Generator: rspirv
|
|
; Bound: 101
|
|
OpCapability Shader
|
|
OpCapability ImageQuery
|
|
OpCapability Linkage
|
|
OpExtension "SPV_KHR_storage_buffer_storage_class"
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpMemberName %8 0 "a"
|
|
OpName %8 "InStorage"
|
|
OpMemberName %11 0 "a"
|
|
OpName %11 "InUniform"
|
|
OpName %21 "in_storage"
|
|
OpName %24 "in_uniform"
|
|
OpName %27 "image_2d_array"
|
|
OpName %29 "in_workgroup"
|
|
OpName %31 "in_private"
|
|
OpName %34 "in_function"
|
|
OpName %38 "c"
|
|
OpName %39 "i"
|
|
OpName %40 "l"
|
|
OpName %41 "mock_function"
|
|
OpDecorate %5 ArrayStride 16
|
|
OpMemberDecorate %8 0 Offset 0
|
|
OpDecorate %9 ArrayStride 16
|
|
OpMemberDecorate %11 0 Offset 0
|
|
OpDecorate %13 ArrayStride 4
|
|
OpDecorate %15 ArrayStride 4
|
|
OpDecorate %19 ArrayStride 16
|
|
OpDecorate %21 NonWritable
|
|
OpDecorate %21 DescriptorSet 0
|
|
OpDecorate %21 Binding 0
|
|
OpDecorate %22 Block
|
|
OpMemberDecorate %22 0 Offset 0
|
|
OpDecorate %24 DescriptorSet 0
|
|
OpDecorate %24 Binding 1
|
|
OpDecorate %25 Block
|
|
OpMemberDecorate %25 0 Offset 0
|
|
OpDecorate %27 DescriptorSet 0
|
|
OpDecorate %27 Binding 2
|
|
%2 = OpTypeVoid
|
|
%4 = OpTypeFloat 32
|
|
%3 = OpTypeVector %4 4
|
|
%7 = OpTypeInt 32 0
|
|
%6 = OpConstant %7 10
|
|
%5 = OpTypeArray %3 %6
|
|
%8 = OpTypeStruct %5
|
|
%10 = OpConstant %7 20
|
|
%9 = OpTypeArray %3 %10
|
|
%11 = OpTypeStruct %9
|
|
%12 = OpTypeImage %4 2D 0 1 0 1 Unknown
|
|
%14 = OpConstant %7 30
|
|
%13 = OpTypeArray %4 %14
|
|
%16 = OpConstant %7 40
|
|
%15 = OpTypeArray %4 %16
|
|
%18 = OpTypeInt 32 1
|
|
%17 = OpTypeVector %18 2
|
|
%20 = OpConstant %7 2
|
|
%19 = OpTypeArray %3 %20
|
|
%22 = OpTypeStruct %8
|
|
%23 = OpTypePointer StorageBuffer %22
|
|
%21 = OpVariable %23 StorageBuffer
|
|
%25 = OpTypeStruct %11
|
|
%26 = OpTypePointer Uniform %25
|
|
%24 = OpVariable %26 Uniform
|
|
%28 = OpTypePointer UniformConstant %12
|
|
%27 = OpVariable %28 UniformConstant
|
|
%30 = OpTypePointer Workgroup %13
|
|
%29 = OpVariable %30 Workgroup
|
|
%32 = OpTypePointer Private %15
|
|
%33 = OpConstantNull %15
|
|
%31 = OpVariable %32 Private %33
|
|
%35 = OpTypePointer Function %19
|
|
%36 = OpConstantNull %19
|
|
%42 = OpTypeFunction %3 %17 %18 %18
|
|
%43 = OpTypePointer StorageBuffer %8
|
|
%44 = OpConstant %7 0
|
|
%46 = OpTypePointer Uniform %11
|
|
%49 = OpConstant %4 0.707
|
|
%50 = OpConstant %4 0.0
|
|
%51 = OpConstant %4 1.0
|
|
%56 = OpTypePointer StorageBuffer %5
|
|
%57 = OpTypePointer StorageBuffer %3
|
|
%60 = OpTypePointer Uniform %9
|
|
%61 = OpTypePointer Uniform %3
|
|
%65 = OpTypeVector %18 3
|
|
%67 = OpTypeBool
|
|
%68 = OpConstantNull %3
|
|
%74 = OpTypeVector %67 3
|
|
%81 = OpTypePointer Workgroup %4
|
|
%82 = OpConstant %7 29
|
|
%88 = OpTypePointer Private %4
|
|
%89 = OpConstant %7 39
|
|
%95 = OpTypePointer Function %3
|
|
%96 = OpConstant %7 1
|
|
%41 = OpFunction %3 None %42
|
|
%38 = OpFunctionParameter %17
|
|
%39 = OpFunctionParameter %18
|
|
%40 = OpFunctionParameter %18
|
|
%37 = OpLabel
|
|
%34 = OpVariable %35 Function %36
|
|
%45 = OpAccessChain %43 %21 %44
|
|
%47 = OpAccessChain %46 %24 %44
|
|
%48 = OpLoad %12 %27
|
|
OpBranch %52
|
|
%52 = OpLabel
|
|
%53 = OpCompositeConstruct %3 %49 %50 %50 %51
|
|
%54 = OpCompositeConstruct %3 %50 %49 %50 %51
|
|
%55 = OpCompositeConstruct %19 %53 %54
|
|
OpStore %34 %55
|
|
%58 = OpAccessChain %57 %45 %44 %39
|
|
%59 = OpLoad %3 %58
|
|
%62 = OpAccessChain %61 %47 %44 %39
|
|
%63 = OpLoad %3 %62
|
|
%64 = OpFAdd %3 %59 %63
|
|
%66 = OpCompositeConstruct %65 %38 %39
|
|
%69 = OpImageQueryLevels %18 %48
|
|
%70 = OpULessThan %67 %40 %69
|
|
OpSelectionMerge %71 None
|
|
OpBranchConditional %70 %72 %71
|
|
%72 = OpLabel
|
|
%73 = OpImageQuerySizeLod %65 %48 %40
|
|
%75 = OpULessThan %74 %66 %73
|
|
%76 = OpAll %67 %75
|
|
OpBranchConditional %76 %77 %71
|
|
%77 = OpLabel
|
|
%78 = OpImageFetch %3 %48 %66 Lod %40
|
|
OpBranch %71
|
|
%71 = OpLabel
|
|
%79 = OpPhi %3 %68 %52 %68 %72 %78 %77
|
|
%80 = OpFAdd %3 %64 %79
|
|
%83 = OpExtInst %7 %1 UMin %39 %82
|
|
%84 = OpAccessChain %81 %29 %83
|
|
%85 = OpLoad %4 %84
|
|
%86 = OpCompositeConstruct %3 %85 %85 %85 %85
|
|
%87 = OpFAdd %3 %80 %86
|
|
%90 = OpExtInst %7 %1 UMin %39 %89
|
|
%91 = OpAccessChain %88 %31 %90
|
|
%92 = OpLoad %4 %91
|
|
%93 = OpCompositeConstruct %3 %92 %92 %92 %92
|
|
%94 = OpFAdd %3 %87 %93
|
|
%97 = OpExtInst %7 %1 UMin %39 %96
|
|
%98 = OpAccessChain %95 %34 %97
|
|
%99 = OpLoad %3 %98
|
|
%100 = OpFAdd %3 %94 %99
|
|
OpReturnValue %100
|
|
OpFunctionEnd |