2021-03-11 20:53:06 +00:00
|
|
|
### Compilation failed:
|
|
|
|
|
|
|
|
error: SPIR-V validation error: Variable must be decorated with a location
|
|
|
|
%src = OpVariable %_ptr_Input_v4float Input
|
|
|
|
|
2020-11-20 21:28:50 +00:00
|
|
|
OpCapability Shader
|
|
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
|
|
OpMemoryModel Logical GLSL450
|
|
|
|
OpEntryPoint Fragment %main "main" %sk_FragColor %sk_Clockwise %src %dst
|
|
|
|
OpExecutionMode %main OriginUpperLeft
|
|
|
|
OpName %sk_FragColor "sk_FragColor"
|
|
|
|
OpName %sk_Clockwise "sk_Clockwise"
|
|
|
|
OpName %src "src"
|
|
|
|
OpName %dst "dst"
|
2020-11-23 19:48:06 +00:00
|
|
|
OpName %_blend_overlay_component "_blend_overlay_component"
|
2020-11-20 21:28:50 +00:00
|
|
|
OpName %main "main"
|
2021-03-15 22:08:38 +00:00
|
|
|
OpName %_0_result "_0_result"
|
2020-11-20 21:28:50 +00:00
|
|
|
OpDecorate %sk_FragColor RelaxedPrecision
|
|
|
|
OpDecorate %sk_FragColor Location 0
|
|
|
|
OpDecorate %sk_FragColor Index 0
|
Revert "Refactored SPIR-V RelaxedPrecision handling"
This reverts commit 9e476b798f03930b6bc7fb6eacab574f197e172d.
Reason for revert: Angry Vulkan bots
Original change's description:
> Refactored SPIR-V RelaxedPrecision handling
>
> The RelaxedPrecision decoration is now handled by nextId(), to make it
> easier to see all spots where a RelaxedPrecision decoration might be
> necessary. The goal of this initial refactor is not to actually fix the
> issues with RelaxedPrecision decorations, but rather to lay the
> groundwork for doing so in followup CLs.
>
> The initial intent of this change was to not affect the SPIR-V at all,
> saving modifications for followups, but there ended up being three kinds
> of changes to the output:
>
> 1. Doing things at nextId() time rather than later means some
> decorations move to an earlier spot in the output. This results in
> diffs, but should not cause any behavioral changes.
> 2. We were incorrectly tagging bools as RelaxedPrecision in some
> situations. By funneling things through fewer code paths, the refactor
> would have caused this to happen in even more situations, and the code
> responsible for the bug was being rewritten in this CL anyway, so it
> seemed worth just fixing the issue as part of this change.
> 3. Funneling things through fewer code paths ended up adding
> (correct) RelaxedPrecision modifiers to binary operations that had
> previously been missing them. It seemed better to just let it happen
> than to try to maintain bug-for-bug compatibility with the previous
> approach.
>
> Change-Id: Ia9654d6b5754e2c797e02226660cb618c9189b36
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/384318
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: I9ada728e5fd5798bc1179640560c2e6045b7efd1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385158
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-03-15 21:24:32 +00:00
|
|
|
OpDecorate %sk_Clockwise RelaxedPrecision
|
2020-11-20 21:28:50 +00:00
|
|
|
OpDecorate %sk_Clockwise BuiltIn FrontFacing
|
|
|
|
OpDecorate %src RelaxedPrecision
|
|
|
|
OpDecorate %dst RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %21 RelaxedPrecision
|
|
|
|
OpDecorate %23 RelaxedPrecision
|
2020-11-20 21:28:50 +00:00
|
|
|
OpDecorate %24 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %32 RelaxedPrecision
|
|
|
|
OpDecorate %34 RelaxedPrecision
|
2020-11-23 19:48:06 +00:00
|
|
|
OpDecorate %35 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %37 RelaxedPrecision
|
2020-11-23 19:48:06 +00:00
|
|
|
OpDecorate %38 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %40 RelaxedPrecision
|
|
|
|
OpDecorate %42 RelaxedPrecision
|
2020-11-23 19:48:06 +00:00
|
|
|
OpDecorate %43 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %45 RelaxedPrecision
|
|
|
|
OpDecorate %47 RelaxedPrecision
|
2020-11-20 21:28:50 +00:00
|
|
|
OpDecorate %48 RelaxedPrecision
|
2020-11-23 19:48:06 +00:00
|
|
|
OpDecorate %49 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %51 RelaxedPrecision
|
|
|
|
OpDecorate %53 RelaxedPrecision
|
2020-11-20 21:28:50 +00:00
|
|
|
OpDecorate %54 RelaxedPrecision
|
|
|
|
OpDecorate %55 RelaxedPrecision
|
2020-11-23 19:48:06 +00:00
|
|
|
OpDecorate %56 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %62 RelaxedPrecision
|
|
|
|
OpDecorate %65 RelaxedPrecision
|
|
|
|
OpDecorate %69 RelaxedPrecision
|
|
|
|
OpDecorate %72 RelaxedPrecision
|
|
|
|
OpDecorate %76 RelaxedPrecision
|
|
|
|
OpDecorate %79 RelaxedPrecision
|
|
|
|
OpDecorate %83 RelaxedPrecision
|
|
|
|
OpDecorate %86 RelaxedPrecision
|
2020-12-17 19:38:56 +00:00
|
|
|
OpDecorate %88 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %89 RelaxedPrecision
|
2020-12-17 19:38:56 +00:00
|
|
|
OpDecorate %91 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %92 RelaxedPrecision
|
2020-12-17 19:38:56 +00:00
|
|
|
OpDecorate %94 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %95 RelaxedPrecision
|
2020-12-17 19:38:56 +00:00
|
|
|
OpDecorate %97 RelaxedPrecision
|
|
|
|
OpDecorate %99 RelaxedPrecision
|
|
|
|
OpDecorate %101 RelaxedPrecision
|
|
|
|
OpDecorate %103 RelaxedPrecision
|
|
|
|
OpDecorate %105 RelaxedPrecision
|
|
|
|
OpDecorate %107 RelaxedPrecision
|
|
|
|
OpDecorate %109 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %110 RelaxedPrecision
|
2020-12-17 19:38:56 +00:00
|
|
|
OpDecorate %112 RelaxedPrecision
|
2021-03-15 22:08:38 +00:00
|
|
|
OpDecorate %113 RelaxedPrecision
|
2020-11-20 21:28:50 +00:00
|
|
|
%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
|
|
|
|
%_ptr_Input_v4float = OpTypePointer Input %v4float
|
|
|
|
%src = OpVariable %_ptr_Input_v4float Input
|
|
|
|
%dst = OpVariable %_ptr_Input_v4float Input
|
2020-11-23 19:48:06 +00:00
|
|
|
%v2float = OpTypeVector %float 2
|
|
|
|
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
2021-03-15 22:08:38 +00:00
|
|
|
%15 = OpTypeFunction %float %_ptr_Function_v2float %_ptr_Function_v2float
|
2020-11-23 19:48:06 +00:00
|
|
|
%float_2 = OpConstant %float 2
|
|
|
|
%_ptr_Function_float = OpTypePointer Function %float
|
2021-03-15 22:08:38 +00:00
|
|
|
%void = OpTypeVoid
|
|
|
|
%58 = OpTypeFunction %void
|
2020-11-20 21:28:50 +00:00
|
|
|
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
|
|
|
%float_1 = OpConstant %float 1
|
|
|
|
%v3float = OpTypeVector %float 3
|
2021-03-15 22:08:38 +00:00
|
|
|
%_blend_overlay_component = OpFunction %float None %15
|
|
|
|
%17 = OpFunctionParameter %_ptr_Function_v2float
|
2020-11-23 19:48:06 +00:00
|
|
|
%18 = OpFunctionParameter %_ptr_Function_v2float
|
2021-03-15 22:08:38 +00:00
|
|
|
%19 = OpLabel
|
|
|
|
%27 = OpVariable %_ptr_Function_float Function
|
|
|
|
%21 = OpLoad %v2float %18
|
|
|
|
%22 = OpCompositeExtract %float %21 0
|
|
|
|
%23 = OpFMul %float %float_2 %22
|
|
|
|
%24 = OpLoad %v2float %18
|
|
|
|
%25 = OpCompositeExtract %float %24 1
|
|
|
|
%26 = OpFOrdLessThanEqual %bool %23 %25
|
|
|
|
OpSelectionMerge %31 None
|
|
|
|
OpBranchConditional %26 %29 %30
|
|
|
|
%29 = OpLabel
|
|
|
|
%32 = OpLoad %v2float %17
|
|
|
|
%33 = OpCompositeExtract %float %32 0
|
|
|
|
%34 = OpFMul %float %float_2 %33
|
|
|
|
%35 = OpLoad %v2float %18
|
|
|
|
%36 = OpCompositeExtract %float %35 0
|
|
|
|
%37 = OpFMul %float %34 %36
|
|
|
|
OpStore %27 %37
|
|
|
|
OpBranch %31
|
2020-11-20 21:28:50 +00:00
|
|
|
%30 = OpLabel
|
2021-03-15 22:08:38 +00:00
|
|
|
%38 = OpLoad %v2float %17
|
|
|
|
%39 = OpCompositeExtract %float %38 1
|
|
|
|
%40 = OpLoad %v2float %18
|
|
|
|
%41 = OpCompositeExtract %float %40 1
|
|
|
|
%42 = OpFMul %float %39 %41
|
|
|
|
%43 = OpLoad %v2float %18
|
|
|
|
%44 = OpCompositeExtract %float %43 1
|
|
|
|
%45 = OpLoad %v2float %18
|
|
|
|
%46 = OpCompositeExtract %float %45 0
|
|
|
|
%47 = OpFSub %float %44 %46
|
|
|
|
%48 = OpFMul %float %float_2 %47
|
|
|
|
%49 = OpLoad %v2float %17
|
|
|
|
%50 = OpCompositeExtract %float %49 1
|
|
|
|
%51 = OpLoad %v2float %17
|
|
|
|
%52 = OpCompositeExtract %float %51 0
|
|
|
|
%53 = OpFSub %float %50 %52
|
|
|
|
%54 = OpFMul %float %48 %53
|
|
|
|
%55 = OpFSub %float %42 %54
|
|
|
|
OpStore %27 %55
|
|
|
|
OpBranch %31
|
2020-11-23 19:48:06 +00:00
|
|
|
%31 = OpLabel
|
2021-03-15 22:08:38 +00:00
|
|
|
%56 = OpLoad %float %27
|
|
|
|
OpReturnValue %56
|
2020-11-23 19:48:06 +00:00
|
|
|
OpFunctionEnd
|
2021-03-15 22:08:38 +00:00
|
|
|
%main = OpFunction %void None %58
|
|
|
|
%59 = OpLabel
|
|
|
|
%_0_result = OpVariable %_ptr_Function_v4float Function
|
|
|
|
%64 = OpVariable %_ptr_Function_v2float Function
|
|
|
|
%67 = OpVariable %_ptr_Function_v2float Function
|
|
|
|
%71 = OpVariable %_ptr_Function_v2float Function
|
|
|
|
%74 = OpVariable %_ptr_Function_v2float Function
|
|
|
|
%78 = OpVariable %_ptr_Function_v2float Function
|
|
|
|
%81 = OpVariable %_ptr_Function_v2float Function
|
|
|
|
%62 = OpLoad %v4float %src
|
|
|
|
%63 = OpVectorShuffle %v2float %62 %62 0 3
|
|
|
|
OpStore %64 %63
|
|
|
|
%65 = OpLoad %v4float %dst
|
|
|
|
%66 = OpVectorShuffle %v2float %65 %65 0 3
|
|
|
|
OpStore %67 %66
|
|
|
|
%68 = OpFunctionCall %float %_blend_overlay_component %64 %67
|
|
|
|
%69 = OpLoad %v4float %src
|
|
|
|
%70 = OpVectorShuffle %v2float %69 %69 1 3
|
|
|
|
OpStore %71 %70
|
|
|
|
%72 = OpLoad %v4float %dst
|
|
|
|
%73 = OpVectorShuffle %v2float %72 %72 1 3
|
|
|
|
OpStore %74 %73
|
|
|
|
%75 = OpFunctionCall %float %_blend_overlay_component %71 %74
|
|
|
|
%76 = OpLoad %v4float %src
|
|
|
|
%77 = OpVectorShuffle %v2float %76 %76 2 3
|
|
|
|
OpStore %78 %77
|
|
|
|
%79 = OpLoad %v4float %dst
|
|
|
|
%80 = OpVectorShuffle %v2float %79 %79 2 3
|
|
|
|
OpStore %81 %80
|
|
|
|
%82 = OpFunctionCall %float %_blend_overlay_component %78 %81
|
|
|
|
%83 = OpLoad %v4float %src
|
|
|
|
%84 = OpCompositeExtract %float %83 3
|
|
|
|
%86 = OpLoad %v4float %src
|
|
|
|
%87 = OpCompositeExtract %float %86 3
|
|
|
|
%88 = OpFSub %float %float_1 %87
|
|
|
|
%89 = OpLoad %v4float %dst
|
|
|
|
%90 = OpCompositeExtract %float %89 3
|
|
|
|
%91 = OpFMul %float %88 %90
|
|
|
|
%92 = OpFAdd %float %84 %91
|
|
|
|
%93 = OpCompositeConstruct %v4float %68 %75 %82 %92
|
|
|
|
OpStore %_0_result %93
|
|
|
|
%94 = OpLoad %v4float %_0_result
|
|
|
|
%95 = OpVectorShuffle %v3float %94 %94 0 1 2
|
|
|
|
%97 = OpLoad %v4float %dst
|
|
|
|
%98 = OpVectorShuffle %v3float %97 %97 0 1 2
|
|
|
|
%99 = OpLoad %v4float %src
|
|
|
|
%100 = OpCompositeExtract %float %99 3
|
|
|
|
%101 = OpFSub %float %float_1 %100
|
|
|
|
%102 = OpVectorTimesScalar %v3float %98 %101
|
|
|
|
%103 = OpLoad %v4float %src
|
|
|
|
%104 = OpVectorShuffle %v3float %103 %103 0 1 2
|
|
|
|
%105 = OpLoad %v4float %dst
|
|
|
|
%106 = OpCompositeExtract %float %105 3
|
|
|
|
%107 = OpFSub %float %float_1 %106
|
|
|
|
%108 = OpVectorTimesScalar %v3float %104 %107
|
|
|
|
%109 = OpFAdd %v3float %102 %108
|
|
|
|
%110 = OpFAdd %v3float %95 %109
|
|
|
|
%111 = OpLoad %v4float %_0_result
|
|
|
|
%112 = OpVectorShuffle %v4float %111 %110 4 5 6 3
|
|
|
|
OpStore %_0_result %112
|
|
|
|
%113 = OpLoad %v4float %_0_result
|
|
|
|
OpStore %sk_FragColor %113
|
2020-11-20 21:28:50 +00:00
|
|
|
OpReturn
|
|
|
|
OpFunctionEnd
|
2021-03-11 20:53:06 +00:00
|
|
|
|
|
|
|
1 error
|