0688ea21b2
This is a reland of commit 60ff0facbf
Structs are now deduplicated using a [Type*, SpvId] map.
Original change's description:
> Use op cache when emitting types.
>
> We no longer need to maintain a separate `fTypeMap` for mapping types
> to SpvIds, since the op cache handles this automatically.
>
> We also now support deduplicating instructions that don't have a result,
> such as decorations. (In particular, we needed to avoid emitting the
> SpvDecorationArrayStride op every time the array type was accessed, but
> this op doesn't have a result ID.)
>
> Change-Id: I779b8c8e3de5973b8f487b28c0a8ece9a1041845
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529732
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
Change-Id: I9f6a78d58e8af38a1fd690a8860d8b5aa3193be6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529748
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
56 lines
1.9 KiB
JavaScript
56 lines
1.9 KiB
JavaScript
OpCapability Shader
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
OpMemoryModel Logical GLSL450
|
|
OpEntryPoint Fragment %main "main" %sk_FragColor %sk_Clockwise
|
|
OpExecutionMode %main OriginUpperLeft
|
|
OpName %sk_FragColor "sk_FragColor"
|
|
OpName %sk_Clockwise "sk_Clockwise"
|
|
OpName %test2D "test2D"
|
|
OpName %test2DRect "test2DRect"
|
|
OpName %main "main"
|
|
OpDecorate %sk_FragColor RelaxedPrecision
|
|
OpDecorate %sk_FragColor Location 0
|
|
OpDecorate %sk_FragColor Index 0
|
|
OpDecorate %sk_Clockwise BuiltIn FrontFacing
|
|
OpDecorate %test2D RelaxedPrecision
|
|
OpDecorate %test2D Binding 0
|
|
OpDecorate %test2D DescriptorSet 0
|
|
OpDecorate %test2DRect RelaxedPrecision
|
|
OpDecorate %test2DRect Binding 1
|
|
OpDecorate %test2DRect DescriptorSet 0
|
|
OpDecorate %19 RelaxedPrecision
|
|
OpDecorate %24 RelaxedPrecision
|
|
OpDecorate %26 RelaxedPrecision
|
|
%float = OpTypeFloat 32
|
|
%v4float = OpTypeVector %float 4
|
|
%_ptr_Output_v4float = OpTypePointer Output %v4float
|
|
%sk_FragColor = OpVariable %_ptr_Output_v4float Output
|
|
%bool = OpTypeBool
|
|
%_ptr_Input_bool = OpTypePointer Input %bool
|
|
%sk_Clockwise = OpVariable %_ptr_Input_bool Input
|
|
%11 = OpTypeImage %float 2D 0 0 0 1 Unknown
|
|
%12 = OpTypeSampledImage %11
|
|
%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12
|
|
%test2D = OpVariable %_ptr_UniformConstant_12 UniformConstant
|
|
%test2DRect = OpVariable %_ptr_UniformConstant_12 UniformConstant
|
|
%void = OpTypeVoid
|
|
%16 = OpTypeFunction %void
|
|
%float_0_5 = OpConstant %float 0.5
|
|
%v2float = OpTypeVector %float 2
|
|
%22 = OpConstantComposite %v2float %float_0_5 %float_0_5
|
|
%v3float = OpTypeVector %float 3
|
|
%28 = OpConstantComposite %v3float %float_0_5 %float_0_5 %float_0_5
|
|
%main = OpFunction %void None %16
|
|
%17 = OpLabel
|
|
%19 = OpLoad %12 %test2D
|
|
%18 = OpImageSampleImplicitLod %v4float %19 %22
|
|
OpStore %sk_FragColor %18
|
|
%24 = OpLoad %12 %test2DRect
|
|
%23 = OpImageSampleImplicitLod %v4float %24 %22
|
|
OpStore %sk_FragColor %23
|
|
%26 = OpLoad %12 %test2DRect
|
|
%25 = OpImageSampleProjImplicitLod %v4float %26 %28
|
|
OpStore %sk_FragColor %25
|
|
OpReturn
|
|
OpFunctionEnd
|