mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 07:21:04 +01:00
* Add FindLsb / FindMsb * Fixes and tests for FindLsb/FindMsb * Add findLsb / findMsb as WGSL builtins * Fix tests * Fix incompatible type issue with MSL output * Requested changes * Test fewer cases of findLsb/findMsb
167 lines
4.4 KiB
Plaintext
167 lines
4.4 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.1
|
|
; Generator: rspirv
|
|
; Bound: 119
|
|
OpCapability Shader
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %40 "main"
|
|
OpExecutionMode %40 LocalSize 1 1 1
|
|
%2 = OpTypeVoid
|
|
%4 = OpTypeInt 32 1
|
|
%3 = OpConstant %4 0
|
|
%6 = OpTypeInt 32 0
|
|
%5 = OpConstant %6 0
|
|
%8 = OpTypeFloat 32
|
|
%7 = OpConstant %8 0.0
|
|
%9 = OpConstant %6 5
|
|
%10 = OpConstant %6 10
|
|
%11 = OpTypeVector %4 2
|
|
%12 = OpTypeVector %4 3
|
|
%13 = OpTypeVector %4 4
|
|
%14 = OpTypeVector %6 2
|
|
%15 = OpTypeVector %6 3
|
|
%16 = OpTypeVector %6 4
|
|
%17 = OpTypeVector %8 2
|
|
%18 = OpTypeVector %8 4
|
|
%20 = OpTypePointer Function %4
|
|
%22 = OpTypePointer Function %11
|
|
%24 = OpTypePointer Function %12
|
|
%26 = OpTypePointer Function %13
|
|
%28 = OpTypePointer Function %6
|
|
%30 = OpTypePointer Function %14
|
|
%32 = OpTypePointer Function %15
|
|
%34 = OpTypePointer Function %16
|
|
%36 = OpTypePointer Function %17
|
|
%38 = OpTypePointer Function %18
|
|
%41 = OpTypeFunction %2
|
|
%40 = OpFunction %2 None %41
|
|
%39 = OpLabel
|
|
%37 = OpVariable %38 Function
|
|
%31 = OpVariable %32 Function
|
|
%25 = OpVariable %26 Function
|
|
%19 = OpVariable %20 Function %3
|
|
%33 = OpVariable %34 Function
|
|
%27 = OpVariable %28 Function %5
|
|
%21 = OpVariable %22 Function
|
|
%35 = OpVariable %36 Function
|
|
%29 = OpVariable %30 Function
|
|
%23 = OpVariable %24 Function
|
|
OpBranch %42
|
|
%42 = OpLabel
|
|
%43 = OpCompositeConstruct %11 %3 %3
|
|
OpStore %21 %43
|
|
%44 = OpCompositeConstruct %12 %3 %3 %3
|
|
OpStore %23 %44
|
|
%45 = OpCompositeConstruct %13 %3 %3 %3 %3
|
|
OpStore %25 %45
|
|
%46 = OpCompositeConstruct %14 %5 %5
|
|
OpStore %29 %46
|
|
%47 = OpCompositeConstruct %15 %5 %5 %5
|
|
OpStore %31 %47
|
|
%48 = OpCompositeConstruct %16 %5 %5 %5 %5
|
|
OpStore %33 %48
|
|
%49 = OpCompositeConstruct %17 %7 %7
|
|
OpStore %35 %49
|
|
%50 = OpCompositeConstruct %18 %7 %7 %7 %7
|
|
OpStore %37 %50
|
|
%51 = OpLoad %18 %37
|
|
%52 = OpExtInst %6 %1 PackSnorm4x8 %51
|
|
OpStore %27 %52
|
|
%53 = OpLoad %18 %37
|
|
%54 = OpExtInst %6 %1 PackUnorm4x8 %53
|
|
OpStore %27 %54
|
|
%55 = OpLoad %17 %35
|
|
%56 = OpExtInst %6 %1 PackSnorm2x16 %55
|
|
OpStore %27 %56
|
|
%57 = OpLoad %17 %35
|
|
%58 = OpExtInst %6 %1 PackUnorm2x16 %57
|
|
OpStore %27 %58
|
|
%59 = OpLoad %17 %35
|
|
%60 = OpExtInst %6 %1 PackHalf2x16 %59
|
|
OpStore %27 %60
|
|
%61 = OpLoad %6 %27
|
|
%62 = OpExtInst %18 %1 UnpackSnorm4x8 %61
|
|
OpStore %37 %62
|
|
%63 = OpLoad %6 %27
|
|
%64 = OpExtInst %18 %1 UnpackUnorm4x8 %63
|
|
OpStore %37 %64
|
|
%65 = OpLoad %6 %27
|
|
%66 = OpExtInst %17 %1 UnpackSnorm2x16 %65
|
|
OpStore %35 %66
|
|
%67 = OpLoad %6 %27
|
|
%68 = OpExtInst %17 %1 UnpackUnorm2x16 %67
|
|
OpStore %35 %68
|
|
%69 = OpLoad %6 %27
|
|
%70 = OpExtInst %17 %1 UnpackHalf2x16 %69
|
|
OpStore %35 %70
|
|
%71 = OpLoad %4 %19
|
|
%72 = OpLoad %4 %19
|
|
%73 = OpBitFieldInsert %4 %71 %72 %9 %10
|
|
OpStore %19 %73
|
|
%74 = OpLoad %11 %21
|
|
%75 = OpLoad %11 %21
|
|
%76 = OpBitFieldInsert %11 %74 %75 %9 %10
|
|
OpStore %21 %76
|
|
%77 = OpLoad %12 %23
|
|
%78 = OpLoad %12 %23
|
|
%79 = OpBitFieldInsert %12 %77 %78 %9 %10
|
|
OpStore %23 %79
|
|
%80 = OpLoad %13 %25
|
|
%81 = OpLoad %13 %25
|
|
%82 = OpBitFieldInsert %13 %80 %81 %9 %10
|
|
OpStore %25 %82
|
|
%83 = OpLoad %6 %27
|
|
%84 = OpLoad %6 %27
|
|
%85 = OpBitFieldInsert %6 %83 %84 %9 %10
|
|
OpStore %27 %85
|
|
%86 = OpLoad %14 %29
|
|
%87 = OpLoad %14 %29
|
|
%88 = OpBitFieldInsert %14 %86 %87 %9 %10
|
|
OpStore %29 %88
|
|
%89 = OpLoad %15 %31
|
|
%90 = OpLoad %15 %31
|
|
%91 = OpBitFieldInsert %15 %89 %90 %9 %10
|
|
OpStore %31 %91
|
|
%92 = OpLoad %16 %33
|
|
%93 = OpLoad %16 %33
|
|
%94 = OpBitFieldInsert %16 %92 %93 %9 %10
|
|
OpStore %33 %94
|
|
%95 = OpLoad %4 %19
|
|
%96 = OpBitFieldSExtract %4 %95 %9 %10
|
|
OpStore %19 %96
|
|
%97 = OpLoad %11 %21
|
|
%98 = OpBitFieldSExtract %11 %97 %9 %10
|
|
OpStore %21 %98
|
|
%99 = OpLoad %12 %23
|
|
%100 = OpBitFieldSExtract %12 %99 %9 %10
|
|
OpStore %23 %100
|
|
%101 = OpLoad %13 %25
|
|
%102 = OpBitFieldSExtract %13 %101 %9 %10
|
|
OpStore %25 %102
|
|
%103 = OpLoad %6 %27
|
|
%104 = OpBitFieldUExtract %6 %103 %9 %10
|
|
OpStore %27 %104
|
|
%105 = OpLoad %14 %29
|
|
%106 = OpBitFieldUExtract %14 %105 %9 %10
|
|
OpStore %29 %106
|
|
%107 = OpLoad %15 %31
|
|
%108 = OpBitFieldUExtract %15 %107 %9 %10
|
|
OpStore %31 %108
|
|
%109 = OpLoad %16 %33
|
|
%110 = OpBitFieldUExtract %16 %109 %9 %10
|
|
OpStore %33 %110
|
|
%111 = OpLoad %4 %19
|
|
%112 = OpExtInst %4 %1 FindILsb %111
|
|
OpStore %19 %112
|
|
%113 = OpLoad %14 %29
|
|
%114 = OpExtInst %11 %1 FindILsb %113
|
|
OpStore %21 %114
|
|
%115 = OpLoad %12 %23
|
|
%116 = OpExtInst %12 %1 FindSMsb %115
|
|
OpStore %23 %116
|
|
%117 = OpLoad %6 %27
|
|
%118 = OpExtInst %4 %1 FindUMsb %117
|
|
OpStore %19 %118
|
|
OpReturn
|
|
OpFunctionEnd |