2021-01-27 18:53:43 +00:00
|
|
|
OpCapability Shader
|
|
|
|
%1 = OpExtInstImport "GLSL.std.450"
|
|
|
|
OpMemoryModel Logical GLSL450
|
2021-03-22 16:05:31 +00:00
|
|
|
OpEntryPoint Fragment %_entrypoint_v "_entrypoint" %sk_FragColor %sk_Clockwise
|
|
|
|
OpExecutionMode %_entrypoint_v OriginUpperLeft
|
2021-01-27 18:53:43 +00:00
|
|
|
OpName %sk_FragColor "sk_FragColor"
|
|
|
|
OpName %sk_Clockwise "sk_Clockwise"
|
Reland "Add support for top-level uniforms in SPIR-V."
This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d.
Reason for revert: fixes ASAN use-after-scope-end issue
Original change's description:
> Revert "Add support for top-level uniforms in SPIR-V."
>
> This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8.
>
> Reason for revert: ASAN breakage on tree for
> Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN
>
> Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame
> #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf)
> This frame has 35 object(s):
> [32, 104) 'body' (line 3363)
> [144, 152) 'main' (line 3365)
> [176, 184) 'ref.tmp' (line 3366)
> [208, 240) '__begin1' (line 3366)
> [272, 304) '__end1' (line 3366)
> [336, 344) 'ref.tmp27' (line 3370)
> [368, 384) 'ref.tmp31' (line 3371)
> [400, 416) 'interfaceVars' (line 3382)
> [432, 440) 'ref.tmp48' (line 3383)
> [464, 496) '__begin151' (line 3383)
> [528, 560) '__end154' (line 3383)
> [592, 596) 'id' (line 3386)
> [608, 624) 'tmp' (line 3393)
> [640, 648) 'ref.tmp114' (line 3398)
> [672, 704) '__begin1117' (line 3398)
> [736, 768) '__end1120' (line 3398)
> [800, 1008) 'uniformBuffer' (line 3405)
> [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable
> [1344, 1360) 'agg.tmp'
> [1376, 1576) 'adapter' (line 3411)
> [1648, 1848) 'ref.tmp179' (line 3413)
> [1920, 1928) 'ref.tmp191' (line 3415)
> [1952, 1960) 'ref.tmp210' (line 3421)
> [1984, 2016) '__begin1213' (line 3421)
> [2048, 2080) '__end1216' (line 3421)
> [2112, 2120) '__begin1242' (line 3427)
> [2144, 2152) '__end1247' (line 3427)
> [2176, 2192) 'entry256' (line 3427)
> [2208, 2224) 'tmp298' (line 3433)
> [2240, 2256) 'agg.tmp307'
> [2272, 2280) '__begin1365' (line 3457)
> [2304, 2312) 'ref.tmp415' (line 3469)
> [2336, 2368) '__begin1418' (line 3469)
> [2400, 2432) '__end1421' (line 3469)
> [2464, 2480) 'agg.tmp436'
>
> Original change's description:
> > Add support for top-level uniforms in SPIR-V.
> >
> > Previously, a uniform not wrapped in an interface block would report a
> > SPIR-V error:
> >
> > "Variables identified with the Uniform storage class are
> > used to access transparent buffer backed resources. Such variables must
> > be typed as OpTypeStruct, or an array of this type..."
> >
> > Now, the SPIR-V code generator automatically detects such global
> > variables and synthesizes a struct named _UniformBuffer to hold them.
> > When these variables are accessed, an OpAccessChain instruction is added
> > to grab the variable out of the struct.
> >
> > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66
> > Bug: skia:11225
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11225
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Bug: skia:11225
Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
|
|
|
OpName %_UniformBuffer "_UniformBuffer"
|
|
|
|
OpMemberName %_UniformBuffer 0 "colorRed"
|
|
|
|
OpMemberName %_UniformBuffer 1 "colorGreen"
|
2021-03-22 16:05:31 +00:00
|
|
|
OpName %_entrypoint_v "_entrypoint_v"
|
2021-01-27 18:53:43 +00:00
|
|
|
OpName %S "S"
|
|
|
|
OpMemberName %S 0 "x"
|
|
|
|
OpMemberName %S 1 "y"
|
2021-03-22 16:05:31 +00:00
|
|
|
OpName %returns_a_struct_S "returns_a_struct_S"
|
2021-01-27 18:53:43 +00:00
|
|
|
OpName %s "s"
|
2021-04-09 03:25:52 +00:00
|
|
|
OpName %constructs_a_struct_S "constructs_a_struct_S"
|
2021-03-22 16:05:31 +00:00
|
|
|
OpName %accepts_a_struct_fS "accepts_a_struct_fS"
|
|
|
|
OpName %modifies_a_struct_vS "modifies_a_struct_vS"
|
2021-01-27 18:53:43 +00:00
|
|
|
OpName %main "main"
|
|
|
|
OpName %s_0 "s"
|
|
|
|
OpName %x "x"
|
2021-04-08 15:44:53 +00:00
|
|
|
OpName %expected "expected"
|
|
|
|
OpName %Nested "Nested"
|
|
|
|
OpMemberName %Nested 0 "a"
|
|
|
|
OpMemberName %Nested 1 "b"
|
|
|
|
OpName %n1 "n1"
|
|
|
|
OpName %n2 "n2"
|
|
|
|
OpName %n3 "n3"
|
2021-01-27 18:53:43 +00:00
|
|
|
OpName %valid "valid"
|
|
|
|
OpDecorate %sk_FragColor RelaxedPrecision
|
|
|
|
OpDecorate %sk_FragColor Location 0
|
|
|
|
OpDecorate %sk_FragColor Index 0
|
|
|
|
OpDecorate %sk_Clockwise BuiltIn FrontFacing
|
Reland "Add support for top-level uniforms in SPIR-V."
This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d.
Reason for revert: fixes ASAN use-after-scope-end issue
Original change's description:
> Revert "Add support for top-level uniforms in SPIR-V."
>
> This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8.
>
> Reason for revert: ASAN breakage on tree for
> Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN
>
> Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame
> #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf)
> This frame has 35 object(s):
> [32, 104) 'body' (line 3363)
> [144, 152) 'main' (line 3365)
> [176, 184) 'ref.tmp' (line 3366)
> [208, 240) '__begin1' (line 3366)
> [272, 304) '__end1' (line 3366)
> [336, 344) 'ref.tmp27' (line 3370)
> [368, 384) 'ref.tmp31' (line 3371)
> [400, 416) 'interfaceVars' (line 3382)
> [432, 440) 'ref.tmp48' (line 3383)
> [464, 496) '__begin151' (line 3383)
> [528, 560) '__end154' (line 3383)
> [592, 596) 'id' (line 3386)
> [608, 624) 'tmp' (line 3393)
> [640, 648) 'ref.tmp114' (line 3398)
> [672, 704) '__begin1117' (line 3398)
> [736, 768) '__end1120' (line 3398)
> [800, 1008) 'uniformBuffer' (line 3405)
> [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable
> [1344, 1360) 'agg.tmp'
> [1376, 1576) 'adapter' (line 3411)
> [1648, 1848) 'ref.tmp179' (line 3413)
> [1920, 1928) 'ref.tmp191' (line 3415)
> [1952, 1960) 'ref.tmp210' (line 3421)
> [1984, 2016) '__begin1213' (line 3421)
> [2048, 2080) '__end1216' (line 3421)
> [2112, 2120) '__begin1242' (line 3427)
> [2144, 2152) '__end1247' (line 3427)
> [2176, 2192) 'entry256' (line 3427)
> [2208, 2224) 'tmp298' (line 3433)
> [2240, 2256) 'agg.tmp307'
> [2272, 2280) '__begin1365' (line 3457)
> [2304, 2312) 'ref.tmp415' (line 3469)
> [2336, 2368) '__begin1418' (line 3469)
> [2400, 2432) '__end1421' (line 3469)
> [2464, 2480) 'agg.tmp436'
>
> Original change's description:
> > Add support for top-level uniforms in SPIR-V.
> >
> > Previously, a uniform not wrapped in an interface block would report a
> > SPIR-V error:
> >
> > "Variables identified with the Uniform storage class are
> > used to access transparent buffer backed resources. Such variables must
> > be typed as OpTypeStruct, or an array of this type..."
> >
> > Now, the SPIR-V code generator automatically detects such global
> > variables and synthesizes a struct named _UniformBuffer to hold them.
> > When these variables are accessed, an OpAccessChain instruction is added
> > to grab the variable out of the struct.
> >
> > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66
> > Bug: skia:11225
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11225
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Bug: skia:11225
Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
|
|
|
OpMemberDecorate %_UniformBuffer 0 Offset 0
|
|
|
|
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
|
|
|
|
OpMemberDecorate %_UniformBuffer 1 Offset 16
|
|
|
|
OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
|
|
|
|
OpDecorate %_UniformBuffer Block
|
2021-04-09 03:25:52 +00:00
|
|
|
OpDecorate %14 Binding 0
|
|
|
|
OpDecorate %14 DescriptorSet 0
|
2021-01-27 18:53:43 +00:00
|
|
|
OpMemberDecorate %S 0 Offset 0
|
|
|
|
OpMemberDecorate %S 1 Offset 4
|
2021-04-26 19:39:17 +00:00
|
|
|
OpDecorate %36 RelaxedPrecision
|
|
|
|
OpDecorate %64 RelaxedPrecision
|
2021-04-08 15:44:53 +00:00
|
|
|
OpMemberDecorate %Nested 0 Offset 0
|
|
|
|
OpMemberDecorate %Nested 0 RelaxedPrecision
|
|
|
|
OpMemberDecorate %Nested 1 Offset 16
|
|
|
|
OpMemberDecorate %Nested 1 RelaxedPrecision
|
2021-04-26 19:39:17 +00:00
|
|
|
OpDecorate %78 RelaxedPrecision
|
|
|
|
OpDecorate %80 RelaxedPrecision
|
|
|
|
OpDecorate %104 RelaxedPrecision
|
|
|
|
OpDecorate %105 RelaxedPrecision
|
|
|
|
OpDecorate %116 RelaxedPrecision
|
|
|
|
OpDecorate %128 RelaxedPrecision
|
|
|
|
OpDecorate %140 RelaxedPrecision
|
|
|
|
OpDecorate %141 RelaxedPrecision
|
|
|
|
OpDecorate %164 RelaxedPrecision
|
|
|
|
OpDecorate %165 RelaxedPrecision
|
|
|
|
OpDecorate %188 RelaxedPrecision
|
|
|
|
OpDecorate %212 RelaxedPrecision
|
|
|
|
OpDecorate %220 RelaxedPrecision
|
|
|
|
OpDecorate %222 RelaxedPrecision
|
|
|
|
OpDecorate %223 RelaxedPrecision
|
2021-01-27 18:53:43 +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
|
Reland "Add support for top-level uniforms in SPIR-V."
This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d.
Reason for revert: fixes ASAN use-after-scope-end issue
Original change's description:
> Revert "Add support for top-level uniforms in SPIR-V."
>
> This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8.
>
> Reason for revert: ASAN breakage on tree for
> Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN
>
> Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame
> #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf)
> This frame has 35 object(s):
> [32, 104) 'body' (line 3363)
> [144, 152) 'main' (line 3365)
> [176, 184) 'ref.tmp' (line 3366)
> [208, 240) '__begin1' (line 3366)
> [272, 304) '__end1' (line 3366)
> [336, 344) 'ref.tmp27' (line 3370)
> [368, 384) 'ref.tmp31' (line 3371)
> [400, 416) 'interfaceVars' (line 3382)
> [432, 440) 'ref.tmp48' (line 3383)
> [464, 496) '__begin151' (line 3383)
> [528, 560) '__end154' (line 3383)
> [592, 596) 'id' (line 3386)
> [608, 624) 'tmp' (line 3393)
> [640, 648) 'ref.tmp114' (line 3398)
> [672, 704) '__begin1117' (line 3398)
> [736, 768) '__end1120' (line 3398)
> [800, 1008) 'uniformBuffer' (line 3405)
> [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable
> [1344, 1360) 'agg.tmp'
> [1376, 1576) 'adapter' (line 3411)
> [1648, 1848) 'ref.tmp179' (line 3413)
> [1920, 1928) 'ref.tmp191' (line 3415)
> [1952, 1960) 'ref.tmp210' (line 3421)
> [1984, 2016) '__begin1213' (line 3421)
> [2048, 2080) '__end1216' (line 3421)
> [2112, 2120) '__begin1242' (line 3427)
> [2144, 2152) '__end1247' (line 3427)
> [2176, 2192) 'entry256' (line 3427)
> [2208, 2224) 'tmp298' (line 3433)
> [2240, 2256) 'agg.tmp307'
> [2272, 2280) '__begin1365' (line 3457)
> [2304, 2312) 'ref.tmp415' (line 3469)
> [2336, 2368) '__begin1418' (line 3469)
> [2400, 2432) '__end1421' (line 3469)
> [2464, 2480) 'agg.tmp436'
>
> Original change's description:
> > Add support for top-level uniforms in SPIR-V.
> >
> > Previously, a uniform not wrapped in an interface block would report a
> > SPIR-V error:
> >
> > "Variables identified with the Uniform storage class are
> > used to access transparent buffer backed resources. Such variables must
> > be typed as OpTypeStruct, or an array of this type..."
> >
> > Now, the SPIR-V code generator automatically detects such global
> > variables and synthesizes a struct named _UniformBuffer to hold them.
> > When these variables are accessed, an OpAccessChain instruction is added
> > to grab the variable out of the struct.
> >
> > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66
> > Bug: skia:11225
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11225
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Bug: skia:11225
Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
|
|
|
%_UniformBuffer = OpTypeStruct %v4float %v4float
|
|
|
|
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
|
2021-04-09 03:25:52 +00:00
|
|
|
%14 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
|
2021-01-27 18:53:43 +00:00
|
|
|
%void = OpTypeVoid
|
2021-04-09 03:25:52 +00:00
|
|
|
%19 = OpTypeFunction %void
|
2021-01-27 18:53:43 +00:00
|
|
|
%int = OpTypeInt 32 1
|
|
|
|
%S = OpTypeStruct %float %int
|
2021-04-26 19:39:17 +00:00
|
|
|
%24 = OpTypeFunction %S
|
2021-01-27 18:53:43 +00:00
|
|
|
%_ptr_Function_S = OpTypePointer Function %S
|
|
|
|
%float_1 = OpConstant %float 1
|
|
|
|
%int_0 = OpConstant %int 0
|
|
|
|
%_ptr_Function_float = OpTypePointer Function %float
|
|
|
|
%int_2 = OpConstant %int 2
|
|
|
|
%int_1 = OpConstant %int 1
|
|
|
|
%_ptr_Function_int = OpTypePointer Function %int
|
2021-04-08 15:44:53 +00:00
|
|
|
%float_2 = OpConstant %float 2
|
|
|
|
%int_3 = OpConstant %int 3
|
2021-04-26 19:39:17 +00:00
|
|
|
%41 = OpTypeFunction %float %_ptr_Function_S
|
|
|
|
%50 = OpTypeFunction %void %_ptr_Function_S
|
|
|
|
%59 = OpTypeFunction %v4float
|
2021-04-08 15:44:53 +00:00
|
|
|
%Nested = OpTypeStruct %S %S
|
|
|
|
%_ptr_Function_Nested = OpTypePointer Function %Nested
|
2021-01-27 18:53:43 +00:00
|
|
|
%_ptr_Function_bool = OpTypePointer Function %bool
|
|
|
|
%false = OpConstantFalse %bool
|
|
|
|
%float_3 = OpConstant %float 3
|
|
|
|
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
Reland "Add support for top-level uniforms in SPIR-V."
This reverts commit 0de76f72cd5ee7cfe33be3945e4a5651fee1331d.
Reason for revert: fixes ASAN use-after-scope-end issue
Original change's description:
> Revert "Add support for top-level uniforms in SPIR-V."
>
> This reverts commit acba30420ce27b3464fd04fac90e822ffd0245d8.
>
> Reason for revert: ASAN breakage on tree for
> Perf-Win2019-Clang-GCE-CPU-AVX2-x86_64-(Debug|Release)-All-ASAN
>
> Address 0x009af69fda78 is located in stack of thread T0 at offset 1272 in frame
> #0 0x7ff75c069ddf in _asan_wrap_RtlReAllocateHeap+0x44014f (c:\b\s\w\ir\build\nanobench.exe+0x1413a9ddf)
> This frame has 35 object(s):
> [32, 104) 'body' (line 3363)
> [144, 152) 'main' (line 3365)
> [176, 184) 'ref.tmp' (line 3366)
> [208, 240) '__begin1' (line 3366)
> [272, 304) '__end1' (line 3366)
> [336, 344) 'ref.tmp27' (line 3370)
> [368, 384) 'ref.tmp31' (line 3371)
> [400, 416) 'interfaceVars' (line 3382)
> [432, 440) 'ref.tmp48' (line 3383)
> [464, 496) '__begin151' (line 3383)
> [528, 560) '__end154' (line 3383)
> [592, 596) 'id' (line 3386)
> [608, 624) 'tmp' (line 3393)
> [640, 648) 'ref.tmp114' (line 3398)
> [672, 704) '__begin1117' (line 3398)
> [736, 768) '__end1120' (line 3398)
> [800, 1008) 'uniformBuffer' (line 3405)
> [1072, 1280) 'ref.tmp159' (line 3407) <== Memory access at offset 1272 is inside this variable
> [1344, 1360) 'agg.tmp'
> [1376, 1576) 'adapter' (line 3411)
> [1648, 1848) 'ref.tmp179' (line 3413)
> [1920, 1928) 'ref.tmp191' (line 3415)
> [1952, 1960) 'ref.tmp210' (line 3421)
> [1984, 2016) '__begin1213' (line 3421)
> [2048, 2080) '__end1216' (line 3421)
> [2112, 2120) '__begin1242' (line 3427)
> [2144, 2152) '__end1247' (line 3427)
> [2176, 2192) 'entry256' (line 3427)
> [2208, 2224) 'tmp298' (line 3433)
> [2240, 2256) 'agg.tmp307'
> [2272, 2280) '__begin1365' (line 3457)
> [2304, 2312) 'ref.tmp415' (line 3469)
> [2336, 2368) '__begin1418' (line 3469)
> [2400, 2432) '__end1421' (line 3469)
> [2464, 2480) 'agg.tmp436'
>
> Original change's description:
> > Add support for top-level uniforms in SPIR-V.
> >
> > Previously, a uniform not wrapped in an interface block would report a
> > SPIR-V error:
> >
> > "Variables identified with the Uniform storage class are
> > used to access transparent buffer backed resources. Such variables must
> > be typed as OpTypeStruct, or an array of this type..."
> >
> > Now, the SPIR-V code generator automatically detects such global
> > variables and synthesizes a struct named _UniformBuffer to hold them.
> > When these variables are accessed, an OpAccessChain instruction is added
> > to grab the variable out of the struct.
> >
> > Change-Id: I5e852d4de01b866c291506cc8cf6eb547f097d66
> > Bug: skia:11225
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360776
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
>
> Change-Id: Ib72e33dbd662a245c20bc9d45d1397454c9588a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:11225
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362057
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com
Bug: skia:11225
Change-Id: I10501c30a701301f6487ea154047ad1c1d0e8c70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362076
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 15:08:50 +00:00
|
|
|
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
|
2021-04-09 03:25:52 +00:00
|
|
|
%_entrypoint_v = OpFunction %void None %19
|
|
|
|
%20 = OpLabel
|
2021-04-26 19:39:17 +00:00
|
|
|
%21 = OpFunctionCall %v4float %main
|
|
|
|
OpStore %sk_FragColor %21
|
2021-01-27 18:53:43 +00:00
|
|
|
OpReturn
|
|
|
|
OpFunctionEnd
|
2021-04-26 19:39:17 +00:00
|
|
|
%returns_a_struct_S = OpFunction %S None %24
|
|
|
|
%25 = OpLabel
|
2021-01-27 18:53:43 +00:00
|
|
|
%s = OpVariable %_ptr_Function_S Function
|
2021-04-26 19:39:17 +00:00
|
|
|
%30 = OpAccessChain %_ptr_Function_float %s %int_0
|
|
|
|
OpStore %30 %float_1
|
|
|
|
%34 = OpAccessChain %_ptr_Function_int %s %int_1
|
|
|
|
OpStore %34 %int_2
|
|
|
|
%36 = OpLoad %S %s
|
|
|
|
OpReturnValue %36
|
2021-01-27 18:53:43 +00:00
|
|
|
OpFunctionEnd
|
2021-04-26 19:39:17 +00:00
|
|
|
%constructs_a_struct_S = OpFunction %S None %24
|
|
|
|
%37 = OpLabel
|
|
|
|
%40 = OpCompositeConstruct %S %float_2 %int_3
|
|
|
|
OpReturnValue %40
|
2021-01-27 18:53:43 +00:00
|
|
|
OpFunctionEnd
|
2021-04-26 19:39:17 +00:00
|
|
|
%accepts_a_struct_fS = OpFunction %float None %41
|
|
|
|
%42 = OpFunctionParameter %_ptr_Function_S
|
|
|
|
%43 = OpLabel
|
|
|
|
%44 = OpAccessChain %_ptr_Function_float %42 %int_0
|
|
|
|
%45 = OpLoad %float %44
|
|
|
|
%46 = OpAccessChain %_ptr_Function_int %42 %int_1
|
|
|
|
%47 = OpLoad %int %46
|
|
|
|
%48 = OpConvertSToF %float %47
|
|
|
|
%49 = OpFAdd %float %45 %48
|
|
|
|
OpReturnValue %49
|
2021-04-09 03:25:52 +00:00
|
|
|
OpFunctionEnd
|
2021-04-26 19:39:17 +00:00
|
|
|
%modifies_a_struct_vS = OpFunction %void None %50
|
|
|
|
%51 = OpFunctionParameter %_ptr_Function_S
|
|
|
|
%52 = OpLabel
|
|
|
|
%53 = OpAccessChain %_ptr_Function_float %51 %int_0
|
|
|
|
%54 = OpLoad %float %53
|
|
|
|
%55 = OpFAdd %float %54 %float_1
|
|
|
|
OpStore %53 %55
|
|
|
|
%56 = OpAccessChain %_ptr_Function_int %51 %int_1
|
|
|
|
%57 = OpLoad %int %56
|
|
|
|
%58 = OpIAdd %int %57 %int_1
|
|
|
|
OpStore %56 %58
|
2021-01-27 18:53:43 +00:00
|
|
|
OpReturn
|
|
|
|
OpFunctionEnd
|
2021-04-26 19:39:17 +00:00
|
|
|
%main = OpFunction %v4float None %59
|
|
|
|
%60 = OpLabel
|
2021-01-27 18:53:43 +00:00
|
|
|
%s_0 = OpVariable %_ptr_Function_S Function
|
|
|
|
%x = OpVariable %_ptr_Function_float Function
|
2021-04-26 19:39:17 +00:00
|
|
|
%65 = OpVariable %_ptr_Function_S Function
|
2021-04-08 15:44:53 +00:00
|
|
|
%expected = OpVariable %_ptr_Function_S Function
|
|
|
|
%n1 = OpVariable %_ptr_Function_Nested Function
|
|
|
|
%n2 = OpVariable %_ptr_Function_Nested Function
|
|
|
|
%n3 = OpVariable %_ptr_Function_Nested Function
|
2021-04-26 19:39:17 +00:00
|
|
|
%81 = OpVariable %_ptr_Function_S Function
|
2021-01-27 18:53:43 +00:00
|
|
|
%valid = OpVariable %_ptr_Function_bool Function
|
2021-04-26 19:39:17 +00:00
|
|
|
%213 = OpVariable %_ptr_Function_v4float Function
|
|
|
|
%62 = OpFunctionCall %S %returns_a_struct_S
|
|
|
|
OpStore %s_0 %62
|
|
|
|
%64 = OpLoad %S %s_0
|
|
|
|
OpStore %65 %64
|
|
|
|
%66 = OpFunctionCall %float %accepts_a_struct_fS %65
|
|
|
|
OpStore %x %66
|
|
|
|
%67 = OpFunctionCall %void %modifies_a_struct_vS %s_0
|
|
|
|
%69 = OpFunctionCall %S %constructs_a_struct_S
|
|
|
|
OpStore %expected %69
|
|
|
|
%75 = OpFunctionCall %S %returns_a_struct_S
|
|
|
|
%76 = OpAccessChain %_ptr_Function_S %n1 %int_1
|
|
|
|
OpStore %76 %75
|
|
|
|
%77 = OpAccessChain %_ptr_Function_S %n1 %int_0
|
|
|
|
OpStore %77 %75
|
|
|
|
%78 = OpLoad %Nested %n1
|
|
|
|
OpStore %n2 %78
|
|
|
|
OpStore %n3 %78
|
|
|
|
%79 = OpAccessChain %_ptr_Function_S %n3 %int_1
|
|
|
|
%80 = OpLoad %S %79
|
|
|
|
OpStore %81 %80
|
|
|
|
%82 = OpFunctionCall %void %modifies_a_struct_vS %81
|
|
|
|
%83 = OpLoad %S %81
|
|
|
|
OpStore %79 %83
|
|
|
|
%87 = OpLoad %float %x
|
|
|
|
%89 = OpFOrdEqual %bool %87 %float_3
|
|
|
|
OpSelectionMerge %91 None
|
|
|
|
OpBranchConditional %89 %90 %91
|
|
|
|
%90 = OpLabel
|
|
|
|
%92 = OpAccessChain %_ptr_Function_float %s_0 %int_0
|
|
|
|
%93 = OpLoad %float %92
|
|
|
|
%94 = OpFOrdEqual %bool %93 %float_2
|
|
|
|
OpBranch %91
|
|
|
|
%91 = OpLabel
|
|
|
|
%95 = OpPhi %bool %false %60 %94 %90
|
2021-04-09 03:25:52 +00:00
|
|
|
OpSelectionMerge %97 None
|
|
|
|
OpBranchConditional %95 %96 %97
|
|
|
|
%96 = OpLabel
|
2021-04-26 19:39:17 +00:00
|
|
|
%98 = OpAccessChain %_ptr_Function_int %s_0 %int_1
|
|
|
|
%99 = OpLoad %int %98
|
|
|
|
%100 = OpIEqual %bool %99 %int_3
|
2021-04-09 03:25:52 +00:00
|
|
|
OpBranch %97
|
|
|
|
%97 = OpLabel
|
2021-04-26 19:39:17 +00:00
|
|
|
%101 = OpPhi %bool %false %91 %100 %96
|
2021-04-09 03:25:52 +00:00
|
|
|
OpSelectionMerge %103 None
|
|
|
|
OpBranchConditional %101 %102 %103
|
|
|
|
%102 = OpLabel
|
2021-04-26 19:39:17 +00:00
|
|
|
%104 = OpLoad %S %s_0
|
|
|
|
%105 = OpLoad %S %expected
|
|
|
|
%106 = OpCompositeExtract %float %104 0
|
|
|
|
%107 = OpCompositeExtract %float %105 0
|
|
|
|
%108 = OpFOrdEqual %bool %106 %107
|
|
|
|
%109 = OpCompositeExtract %int %104 1
|
|
|
|
%110 = OpCompositeExtract %int %105 1
|
|
|
|
%111 = OpIEqual %bool %109 %110
|
|
|
|
%112 = OpLogicalAnd %bool %111 %108
|
2021-04-09 03:25:52 +00:00
|
|
|
OpBranch %103
|
|
|
|
%103 = OpLabel
|
2021-04-26 19:39:17 +00:00
|
|
|
%113 = OpPhi %bool %false %97 %112 %102
|
|
|
|
OpSelectionMerge %115 None
|
|
|
|
OpBranchConditional %113 %114 %115
|
|
|
|
%114 = OpLabel
|
|
|
|
%116 = OpLoad %S %s_0
|
|
|
|
%117 = OpCompositeConstruct %S %float_2 %int_3
|
|
|
|
%118 = OpCompositeExtract %float %116 0
|
|
|
|
%119 = OpCompositeExtract %float %117 0
|
|
|
|
%120 = OpFOrdEqual %bool %118 %119
|
|
|
|
%121 = OpCompositeExtract %int %116 1
|
|
|
|
%122 = OpCompositeExtract %int %117 1
|
|
|
|
%123 = OpIEqual %bool %121 %122
|
|
|
|
%124 = OpLogicalAnd %bool %123 %120
|
|
|
|
OpBranch %115
|
|
|
|
%115 = OpLabel
|
|
|
|
%125 = OpPhi %bool %false %103 %124 %114
|
|
|
|
OpSelectionMerge %127 None
|
|
|
|
OpBranchConditional %125 %126 %127
|
|
|
|
%126 = OpLabel
|
|
|
|
%128 = OpLoad %S %s_0
|
|
|
|
%129 = OpFunctionCall %S %returns_a_struct_S
|
|
|
|
%130 = OpCompositeExtract %float %128 0
|
|
|
|
%131 = OpCompositeExtract %float %129 0
|
|
|
|
%132 = OpFOrdNotEqual %bool %130 %131
|
|
|
|
%133 = OpCompositeExtract %int %128 1
|
|
|
|
%134 = OpCompositeExtract %int %129 1
|
|
|
|
%135 = OpINotEqual %bool %133 %134
|
|
|
|
%136 = OpLogicalOr %bool %135 %132
|
|
|
|
OpBranch %127
|
|
|
|
%127 = OpLabel
|
|
|
|
%137 = OpPhi %bool %false %115 %136 %126
|
|
|
|
OpSelectionMerge %139 None
|
|
|
|
OpBranchConditional %137 %138 %139
|
|
|
|
%138 = OpLabel
|
|
|
|
%140 = OpLoad %Nested %n1
|
|
|
|
%141 = OpLoad %Nested %n2
|
|
|
|
%142 = OpCompositeExtract %S %140 0
|
|
|
|
%143 = OpCompositeExtract %S %141 0
|
|
|
|
%144 = OpCompositeExtract %float %142 0
|
|
|
|
%145 = OpCompositeExtract %float %143 0
|
|
|
|
%146 = OpFOrdEqual %bool %144 %145
|
|
|
|
%147 = OpCompositeExtract %int %142 1
|
|
|
|
%148 = OpCompositeExtract %int %143 1
|
|
|
|
%149 = OpIEqual %bool %147 %148
|
|
|
|
%150 = OpLogicalAnd %bool %149 %146
|
|
|
|
%151 = OpCompositeExtract %S %140 1
|
|
|
|
%152 = OpCompositeExtract %S %141 1
|
|
|
|
%153 = OpCompositeExtract %float %151 0
|
|
|
|
%154 = OpCompositeExtract %float %152 0
|
|
|
|
%155 = OpFOrdEqual %bool %153 %154
|
|
|
|
%156 = OpCompositeExtract %int %151 1
|
|
|
|
%157 = OpCompositeExtract %int %152 1
|
|
|
|
%158 = OpIEqual %bool %156 %157
|
|
|
|
%159 = OpLogicalAnd %bool %158 %155
|
|
|
|
%160 = OpLogicalAnd %bool %159 %150
|
|
|
|
OpBranch %139
|
|
|
|
%139 = OpLabel
|
|
|
|
%161 = OpPhi %bool %false %127 %160 %138
|
|
|
|
OpSelectionMerge %163 None
|
|
|
|
OpBranchConditional %161 %162 %163
|
|
|
|
%162 = OpLabel
|
|
|
|
%164 = OpLoad %Nested %n1
|
|
|
|
%165 = OpLoad %Nested %n3
|
|
|
|
%166 = OpCompositeExtract %S %164 0
|
|
|
|
%167 = OpCompositeExtract %S %165 0
|
|
|
|
%168 = OpCompositeExtract %float %166 0
|
|
|
|
%169 = OpCompositeExtract %float %167 0
|
|
|
|
%170 = OpFOrdNotEqual %bool %168 %169
|
|
|
|
%171 = OpCompositeExtract %int %166 1
|
|
|
|
%172 = OpCompositeExtract %int %167 1
|
|
|
|
%173 = OpINotEqual %bool %171 %172
|
|
|
|
%174 = OpLogicalOr %bool %173 %170
|
|
|
|
%175 = OpCompositeExtract %S %164 1
|
|
|
|
%176 = OpCompositeExtract %S %165 1
|
|
|
|
%177 = OpCompositeExtract %float %175 0
|
|
|
|
%178 = OpCompositeExtract %float %176 0
|
|
|
|
%179 = OpFOrdNotEqual %bool %177 %178
|
|
|
|
%180 = OpCompositeExtract %int %175 1
|
|
|
|
%181 = OpCompositeExtract %int %176 1
|
|
|
|
%182 = OpINotEqual %bool %180 %181
|
|
|
|
%183 = OpLogicalOr %bool %182 %179
|
|
|
|
%184 = OpLogicalOr %bool %183 %174
|
|
|
|
OpBranch %163
|
|
|
|
%163 = OpLabel
|
|
|
|
%185 = OpPhi %bool %false %139 %184 %162
|
|
|
|
OpSelectionMerge %187 None
|
|
|
|
OpBranchConditional %185 %186 %187
|
|
|
|
%186 = OpLabel
|
|
|
|
%188 = OpLoad %Nested %n3
|
|
|
|
%189 = OpCompositeConstruct %S %float_1 %int_2
|
|
|
|
%190 = OpCompositeConstruct %S %float_2 %int_3
|
|
|
|
%191 = OpCompositeConstruct %Nested %189 %190
|
|
|
|
%192 = OpCompositeExtract %S %188 0
|
|
|
|
%193 = OpCompositeExtract %S %191 0
|
|
|
|
%194 = OpCompositeExtract %float %192 0
|
|
|
|
%195 = OpCompositeExtract %float %193 0
|
|
|
|
%196 = OpFOrdEqual %bool %194 %195
|
|
|
|
%197 = OpCompositeExtract %int %192 1
|
|
|
|
%198 = OpCompositeExtract %int %193 1
|
|
|
|
%199 = OpIEqual %bool %197 %198
|
|
|
|
%200 = OpLogicalAnd %bool %199 %196
|
|
|
|
%201 = OpCompositeExtract %S %188 1
|
|
|
|
%202 = OpCompositeExtract %S %191 1
|
|
|
|
%203 = OpCompositeExtract %float %201 0
|
|
|
|
%204 = OpCompositeExtract %float %202 0
|
|
|
|
%205 = OpFOrdEqual %bool %203 %204
|
|
|
|
%206 = OpCompositeExtract %int %201 1
|
|
|
|
%207 = OpCompositeExtract %int %202 1
|
|
|
|
%208 = OpIEqual %bool %206 %207
|
|
|
|
%209 = OpLogicalAnd %bool %208 %205
|
|
|
|
%210 = OpLogicalAnd %bool %209 %200
|
|
|
|
OpBranch %187
|
|
|
|
%187 = OpLabel
|
|
|
|
%211 = OpPhi %bool %false %163 %210 %186
|
|
|
|
OpStore %valid %211
|
|
|
|
%212 = OpLoad %bool %valid
|
|
|
|
OpSelectionMerge %217 None
|
|
|
|
OpBranchConditional %212 %215 %216
|
|
|
|
%215 = OpLabel
|
|
|
|
%218 = OpAccessChain %_ptr_Uniform_v4float %14 %int_1
|
|
|
|
%220 = OpLoad %v4float %218
|
|
|
|
OpStore %213 %220
|
|
|
|
OpBranch %217
|
|
|
|
%216 = OpLabel
|
|
|
|
%221 = OpAccessChain %_ptr_Uniform_v4float %14 %int_0
|
|
|
|
%222 = OpLoad %v4float %221
|
|
|
|
OpStore %213 %222
|
|
|
|
OpBranch %217
|
|
|
|
%217 = OpLabel
|
|
|
|
%223 = OpLoad %v4float %213
|
|
|
|
OpReturnValue %223
|
2021-01-27 18:53:43 +00:00
|
|
|
OpFunctionEnd
|