Files
wgpu/tests/out/spv/interface.vertex.spvasm
T
Jim Blandy d44e2ad207 Simplify interpolation defaulting.
Replace `Module::apply_common_default_interpolation` with a simpler function
that handles a single `Binding` at a time. In exchange for the simplicity, the
function must be called at each point function arguments, function results, and
struct members are prepared. (Any missed spots will be caught by the verifier.)

This approach no longer requires mutating types in the arena, a prerequisite for
properly handling type identity.

Applying defaults to struct members when the struct declaration is parsed does
have a disadvantage, compared to the old whole-module pass: at struct parse
time, we don't yet know which pipeline stages the struct will be used in. The
best we can do is apply defaults to anything with a `Location` binding. This
causes needless qualifiers to appear in some output. However, it seems that our
back end languages all tolerate such qualifiers.
2021-09-27 15:17:41 -04:00

66 lines
1.7 KiB
Plaintext

; SPIR-V
; Version: 1.0
; Generator: rspirv
; Bound: 41
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %31 "vertex" %18 %21 %23 %25 %27 %29
OpMemberDecorate %12 0 Offset 0
OpMemberDecorate %12 1 Offset 16
OpMemberDecorate %13 0 Offset 0
OpMemberDecorate %13 1 Offset 4
OpMemberDecorate %13 2 Offset 8
OpDecorate %15 ArrayStride 4
OpDecorate %18 BuiltIn VertexIndex
OpDecorate %21 BuiltIn InstanceIndex
OpDecorate %23 Location 10
OpDecorate %23 Flat
OpDecorate %25 BuiltIn Position
OpDecorate %27 Location 1
OpDecorate %29 BuiltIn PointSize
%2 = OpTypeVoid
%4 = OpTypeFloat 32
%3 = OpConstant %4 1.0
%6 = OpTypeInt 32 0
%5 = OpConstant %6 1
%7 = OpConstant %4 0.0
%9 = OpTypeInt 32 1
%8 = OpConstant %9 1
%10 = OpConstant %9 0
%11 = OpTypeVector %4 4
%12 = OpTypeStruct %11 %4
%13 = OpTypeStruct %4 %6 %4
%14 = OpTypeBool
%15 = OpTypeArray %6 %8
%16 = OpTypeVector %6 3
%19 = OpTypePointer Input %6
%18 = OpVariable %19 Input
%21 = OpVariable %19 Input
%23 = OpVariable %19 Input
%26 = OpTypePointer Output %11
%25 = OpVariable %26 Output
%28 = OpTypePointer Output %4
%27 = OpVariable %28 Output
%30 = OpTypePointer Output %4
%29 = OpVariable %30 Output
%32 = OpTypeFunction %2
%31 = OpFunction %2 None %32
%17 = OpLabel
%20 = OpLoad %6 %18
%22 = OpLoad %6 %21
%24 = OpLoad %6 %23
OpStore %29 %3
OpBranch %33
%33 = OpLabel
%34 = OpIAdd %6 %20 %22
%35 = OpIAdd %6 %34 %24
%36 = OpCompositeConstruct %11 %3 %3 %3 %3
%37 = OpConvertUToF %4 %35
%38 = OpCompositeConstruct %12 %36 %37
%39 = OpCompositeExtract %11 %38 0
OpStore %25 %39
%40 = OpCompositeExtract %4 %38 1
OpStore %27 %40
OpReturn
OpFunctionEnd