mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
* [naga] Add `LiteralVector` and `match_literal_vector!` Co-authored-by: SelkoSays <70065171+SelkoSays@users.noreply.github.com> Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * [naga] Implement builtins dot, length, distance, normalize in const using LiteralVector Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update snapshots Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Co-authored-by: SelkoSays <70065171+SelkoSays@users.noreply.github.com>
97 lines
2.5 KiB
Plaintext
97 lines
2.5 KiB
Plaintext
; SPIR-V
|
|
; Version: 1.1
|
|
; Generator: rspirv
|
|
; Bound: 75
|
|
OpCapability Shader
|
|
OpCapability DotProduct
|
|
OpCapability DotProductInput4x8BitPacked
|
|
OpExtension "SPV_KHR_integer_dot_product"
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint GLCompute %69 "main"
|
|
OpExecutionMode %69 LocalSize 1 1 1
|
|
%2 = OpTypeVoid
|
|
%4 = OpTypeFloat 32
|
|
%3 = OpTypeVector %4 2
|
|
%5 = OpTypeInt 32 1
|
|
%6 = OpTypeInt 32 0
|
|
%9 = OpTypeFunction %3
|
|
%10 = OpConstant %4 2
|
|
%11 = OpConstantComposite %3 %10 %10
|
|
%12 = OpConstant %4 0.5
|
|
%13 = OpConstantComposite %3 %12 %12
|
|
%18 = OpTypeFunction %5
|
|
%19 = OpConstant %5 1
|
|
%20 = OpTypeVector %5 2
|
|
%21 = OpConstantComposite %20 %19 %19
|
|
%22 = OpConstant %6 1
|
|
%23 = OpTypeVector %6 3
|
|
%24 = OpConstantComposite %23 %22 %22 %22
|
|
%25 = OpConstant %5 32
|
|
%28 = OpConstantNull %5
|
|
%37 = OpConstantNull %6
|
|
%51 = OpTypeFunction %6
|
|
%52 = OpConstant %6 2
|
|
%53 = OpConstant %6 3
|
|
%54 = OpConstant %6 4
|
|
%55 = OpConstant %6 5
|
|
%56 = OpConstant %6 6
|
|
%57 = OpConstant %6 7
|
|
%58 = OpConstant %6 8
|
|
%70 = OpTypeFunction %2
|
|
%8 = OpFunction %3 None %9
|
|
%7 = OpLabel
|
|
OpBranch %14
|
|
%14 = OpLabel
|
|
%15 = OpExtInst %3 %1 Fma %11 %13 %13
|
|
OpReturnValue %15
|
|
OpFunctionEnd
|
|
%17 = OpFunction %5 None %18
|
|
%16 = OpLabel
|
|
OpBranch %26
|
|
%26 = OpLabel
|
|
%29 = OpCompositeExtract %5 %21 0
|
|
%30 = OpCompositeExtract %5 %21 0
|
|
%31 = OpIMul %5 %29 %30
|
|
%32 = OpIAdd %5 %28 %31
|
|
%33 = OpCompositeExtract %5 %21 1
|
|
%34 = OpCompositeExtract %5 %21 1
|
|
%35 = OpIMul %5 %33 %34
|
|
%27 = OpIAdd %5 %32 %35
|
|
%38 = OpCompositeExtract %6 %24 0
|
|
%39 = OpCompositeExtract %6 %24 0
|
|
%40 = OpIMul %6 %38 %39
|
|
%41 = OpIAdd %6 %37 %40
|
|
%42 = OpCompositeExtract %6 %24 1
|
|
%43 = OpCompositeExtract %6 %24 1
|
|
%44 = OpIMul %6 %42 %43
|
|
%45 = OpIAdd %6 %41 %44
|
|
%46 = OpCompositeExtract %6 %24 2
|
|
%47 = OpCompositeExtract %6 %24 2
|
|
%48 = OpIMul %6 %46 %47
|
|
%36 = OpIAdd %6 %45 %48
|
|
OpReturnValue %25
|
|
OpFunctionEnd
|
|
%50 = OpFunction %6 None %51
|
|
%49 = OpLabel
|
|
OpBranch %59
|
|
%59 = OpLabel
|
|
%60 = OpSDot %5 %22 %52 PackedVectorFormat4x8Bit
|
|
%61 = OpUDot %6 %53 %54 PackedVectorFormat4x8Bit
|
|
%62 = OpIAdd %6 %55 %61
|
|
%63 = OpIAdd %6 %56 %61
|
|
%64 = OpSDot %5 %62 %63 PackedVectorFormat4x8Bit
|
|
%65 = OpIAdd %6 %57 %61
|
|
%66 = OpIAdd %6 %58 %61
|
|
%67 = OpUDot %6 %65 %66 PackedVectorFormat4x8Bit
|
|
OpReturnValue %67
|
|
OpFunctionEnd
|
|
%69 = OpFunction %2 None %70
|
|
%68 = OpLabel
|
|
OpBranch %71
|
|
%71 = OpLabel
|
|
%72 = OpFunctionCall %3 %8
|
|
%73 = OpFunctionCall %5 %17
|
|
%74 = OpFunctionCall %6 %50
|
|
OpReturn
|
|
OpFunctionEnd |