Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +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
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
OpName %sk_FragColor "sk_FragColor"
|
|
|
|
OpName %sk_Clockwise "sk_Clockwise"
|
|
|
|
OpName %_UniformBuffer "_UniformBuffer"
|
|
|
|
OpMemberName %_UniformBuffer 0 "testInputs"
|
|
|
|
OpMemberName %_UniformBuffer 1 "colorGreen"
|
|
|
|
OpMemberName %_UniformBuffer 2 "colorRed"
|
2021-03-22 16:05:31 +00:00
|
|
|
OpName %_entrypoint_v "_entrypoint_v"
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
OpName %main "main"
|
|
|
|
OpName %intValues "intValues"
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
OpName %expectedA "expectedA"
|
2021-03-08 18:29:15 +00:00
|
|
|
OpName %clampLow "clampLow"
|
|
|
|
OpName %expectedB "expectedB"
|
|
|
|
OpName %clampHigh "clampHigh"
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
OpDecorate %sk_FragColor RelaxedPrecision
|
|
|
|
OpDecorate %sk_FragColor Location 0
|
|
|
|
OpDecorate %sk_FragColor Index 0
|
|
|
|
OpDecorate %sk_Clockwise BuiltIn FrontFacing
|
|
|
|
OpMemberDecorate %_UniformBuffer 0 Offset 0
|
|
|
|
OpMemberDecorate %_UniformBuffer 0 RelaxedPrecision
|
|
|
|
OpMemberDecorate %_UniformBuffer 1 Offset 16
|
|
|
|
OpMemberDecorate %_UniformBuffer 1 RelaxedPrecision
|
|
|
|
OpMemberDecorate %_UniformBuffer 2 Offset 32
|
|
|
|
OpMemberDecorate %_UniformBuffer 2 RelaxedPrecision
|
|
|
|
OpDecorate %_UniformBuffer Block
|
|
|
|
OpDecorate %10 Binding 0
|
|
|
|
OpDecorate %10 DescriptorSet 0
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
OpDecorate %33 RelaxedPrecision
|
|
|
|
OpDecorate %35 RelaxedPrecision
|
|
|
|
OpDecorate %36 RelaxedPrecision
|
2021-04-21 18:27:08 +00:00
|
|
|
OpDecorate %38 RelaxedPrecision
|
|
|
|
OpDecorate %40 RelaxedPrecision
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
OpDecorate %42 RelaxedPrecision
|
|
|
|
OpDecorate %212 RelaxedPrecision
|
|
|
|
OpDecorate %215 RelaxedPrecision
|
|
|
|
OpDecorate %216 RelaxedPrecision
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +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
|
|
|
|
%_UniformBuffer = OpTypeStruct %v4float %v4float %v4float
|
|
|
|
%_ptr_Uniform__UniformBuffer = OpTypePointer Uniform %_UniformBuffer
|
|
|
|
%10 = OpVariable %_ptr_Uniform__UniformBuffer Uniform
|
|
|
|
%void = OpTypeVoid
|
|
|
|
%15 = OpTypeFunction %void
|
2021-04-21 18:27:08 +00:00
|
|
|
%v2float = OpTypeVector %float 2
|
|
|
|
%float_0 = OpConstant %float 0
|
|
|
|
%19 = OpConstantComposite %v2float %float_0 %float_0
|
|
|
|
%_ptr_Function_v2float = OpTypePointer Function %v2float
|
|
|
|
%23 = OpTypeFunction %v4float %_ptr_Function_v2float
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
%int = OpTypeInt 32 1
|
|
|
|
%v4int = OpTypeVector %int 4
|
|
|
|
%_ptr_Function_v4int = OpTypePointer Function %v4int
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
|
2021-03-04 15:19:48 +00:00
|
|
|
%int_0 = OpConstant %int 0
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%float_100 = OpConstant %float 100
|
|
|
|
%int_n100 = OpConstant %int -100
|
2021-03-08 18:29:15 +00:00
|
|
|
%int_75 = OpConstant %int 75
|
|
|
|
%int_100 = OpConstant %int 100
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%49 = OpConstantComposite %v4int %int_n100 %int_0 %int_75 %int_100
|
2021-03-08 18:29:15 +00:00
|
|
|
%int_n200 = OpConstant %int -200
|
2021-04-21 18:27:08 +00:00
|
|
|
%52 = OpConstantComposite %v4int %int_n100 %int_n200 %int_n200 %int_100
|
2021-03-08 18:29:15 +00:00
|
|
|
%int_50 = OpConstant %int 50
|
|
|
|
%int_225 = OpConstant %int 225
|
2021-04-21 18:27:08 +00:00
|
|
|
%56 = OpConstantComposite %v4int %int_n100 %int_0 %int_50 %int_225
|
2021-03-08 18:29:15 +00:00
|
|
|
%int_200 = OpConstant %int 200
|
|
|
|
%int_300 = OpConstant %int 300
|
2021-04-21 18:27:08 +00:00
|
|
|
%60 = OpConstantComposite %v4int %int_100 %int_200 %int_50 %int_300
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
%false = OpConstantFalse %bool
|
|
|
|
%v2int = OpTypeVector %int 2
|
|
|
|
%v2bool = OpTypeVector %bool 2
|
|
|
|
%v3int = OpTypeVector %int 3
|
|
|
|
%v3bool = OpTypeVector %bool 3
|
|
|
|
%v4bool = OpTypeVector %bool 4
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%115 = OpConstantComposite %v2int %int_n100 %int_0
|
|
|
|
%123 = OpConstantComposite %v3int %int_n100 %int_0 %int_75
|
|
|
|
%149 = OpConstantComposite %v2int %int_n100 %int_n200
|
|
|
|
%150 = OpConstantComposite %v2int %int_100 %int_200
|
|
|
|
%161 = OpConstantComposite %v3int %int_n100 %int_n200 %int_n200
|
|
|
|
%162 = OpConstantComposite %v3int %int_100 %int_200 %int_50
|
|
|
|
%193 = OpConstantComposite %v3int %int_n100 %int_0 %int_50
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
%_ptr_Function_v4float = OpTypePointer Function %v4float
|
|
|
|
%int_1 = OpConstant %int 1
|
|
|
|
%int_2 = OpConstant %int 2
|
2021-03-22 16:05:31 +00:00
|
|
|
%_entrypoint_v = OpFunction %void None %15
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
%16 = OpLabel
|
2021-04-21 18:27:08 +00:00
|
|
|
%20 = OpVariable %_ptr_Function_v2float Function
|
|
|
|
OpStore %20 %19
|
|
|
|
%22 = OpFunctionCall %v4float %main %20
|
|
|
|
OpStore %sk_FragColor %22
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
OpReturn
|
|
|
|
OpFunctionEnd
|
2021-04-21 18:27:08 +00:00
|
|
|
%main = OpFunction %v4float None %23
|
|
|
|
%24 = OpFunctionParameter %_ptr_Function_v2float
|
|
|
|
%25 = OpLabel
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
%intValues = OpVariable %_ptr_Function_v4int Function
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%expectedA = OpVariable %_ptr_Function_v4int Function
|
2021-03-08 18:29:15 +00:00
|
|
|
%clampLow = OpVariable %_ptr_Function_v4int Function
|
|
|
|
%expectedB = OpVariable %_ptr_Function_v4int Function
|
|
|
|
%clampHigh = OpVariable %_ptr_Function_v4int Function
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%205 = OpVariable %_ptr_Function_v4float Function
|
|
|
|
%30 = OpAccessChain %_ptr_Uniform_v4float %10 %int_0
|
|
|
|
%33 = OpLoad %v4float %30
|
|
|
|
%35 = OpVectorTimesScalar %v4float %33 %float_100
|
|
|
|
%36 = OpCompositeExtract %float %35 0
|
|
|
|
%37 = OpConvertFToS %int %36
|
|
|
|
%38 = OpCompositeExtract %float %35 1
|
|
|
|
%39 = OpConvertFToS %int %38
|
|
|
|
%40 = OpCompositeExtract %float %35 2
|
|
|
|
%41 = OpConvertFToS %int %40
|
|
|
|
%42 = OpCompositeExtract %float %35 3
|
|
|
|
%43 = OpConvertFToS %int %42
|
|
|
|
%44 = OpCompositeConstruct %v4int %37 %39 %41 %43
|
|
|
|
OpStore %intValues %44
|
|
|
|
OpStore %expectedA %49
|
2021-04-21 18:27:08 +00:00
|
|
|
OpStore %clampLow %52
|
|
|
|
OpStore %expectedB %56
|
|
|
|
OpStore %clampHigh %60
|
|
|
|
%63 = OpLoad %v4int %intValues
|
|
|
|
%64 = OpCompositeExtract %int %63 0
|
|
|
|
%62 = OpExtInst %int %1 SClamp %64 %int_n100 %int_100
|
|
|
|
%65 = OpLoad %v4int %expectedA
|
|
|
|
%66 = OpCompositeExtract %int %65 0
|
|
|
|
%67 = OpIEqual %bool %62 %66
|
|
|
|
OpSelectionMerge %69 None
|
|
|
|
OpBranchConditional %67 %68 %69
|
|
|
|
%68 = OpLabel
|
|
|
|
%71 = OpLoad %v4int %intValues
|
|
|
|
%72 = OpVectorShuffle %v2int %71 %71 0 1
|
2021-05-14 14:29:23 +00:00
|
|
|
%74 = OpCompositeConstruct %v2int %int_n100 %int_n100
|
|
|
|
%75 = OpCompositeConstruct %v2int %int_100 %int_100
|
2021-04-21 18:27:08 +00:00
|
|
|
%70 = OpExtInst %v2int %1 SClamp %72 %74 %75
|
|
|
|
%76 = OpLoad %v4int %expectedA
|
|
|
|
%77 = OpVectorShuffle %v2int %76 %76 0 1
|
|
|
|
%78 = OpIEqual %v2bool %70 %77
|
|
|
|
%80 = OpAll %bool %78
|
|
|
|
OpBranch %69
|
|
|
|
%69 = OpLabel
|
|
|
|
%81 = OpPhi %bool %false %25 %80 %68
|
|
|
|
OpSelectionMerge %83 None
|
|
|
|
OpBranchConditional %81 %82 %83
|
|
|
|
%82 = OpLabel
|
|
|
|
%85 = OpLoad %v4int %intValues
|
|
|
|
%86 = OpVectorShuffle %v3int %85 %85 0 1 2
|
2021-05-14 14:29:23 +00:00
|
|
|
%88 = OpCompositeConstruct %v3int %int_n100 %int_n100 %int_n100
|
|
|
|
%89 = OpCompositeConstruct %v3int %int_100 %int_100 %int_100
|
2021-04-21 18:27:08 +00:00
|
|
|
%84 = OpExtInst %v3int %1 SClamp %86 %88 %89
|
|
|
|
%90 = OpLoad %v4int %expectedA
|
|
|
|
%91 = OpVectorShuffle %v3int %90 %90 0 1 2
|
|
|
|
%92 = OpIEqual %v3bool %84 %91
|
|
|
|
%94 = OpAll %bool %92
|
|
|
|
OpBranch %83
|
|
|
|
%83 = OpLabel
|
|
|
|
%95 = OpPhi %bool %false %69 %94 %82
|
|
|
|
OpSelectionMerge %97 None
|
|
|
|
OpBranchConditional %95 %96 %97
|
|
|
|
%96 = OpLabel
|
|
|
|
%99 = OpLoad %v4int %intValues
|
2021-05-14 14:29:23 +00:00
|
|
|
%100 = OpCompositeConstruct %v4int %int_n100 %int_n100 %int_n100 %int_n100
|
|
|
|
%101 = OpCompositeConstruct %v4int %int_100 %int_100 %int_100 %int_100
|
2021-04-21 18:27:08 +00:00
|
|
|
%98 = OpExtInst %v4int %1 SClamp %99 %100 %101
|
|
|
|
%102 = OpLoad %v4int %expectedA
|
|
|
|
%103 = OpIEqual %v4bool %98 %102
|
|
|
|
%105 = OpAll %bool %103
|
|
|
|
OpBranch %97
|
|
|
|
%97 = OpLabel
|
|
|
|
%106 = OpPhi %bool %false %83 %105 %96
|
|
|
|
OpSelectionMerge %108 None
|
|
|
|
OpBranchConditional %106 %107 %108
|
|
|
|
%107 = OpLabel
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%109 = OpLoad %v4int %expectedA
|
|
|
|
%110 = OpCompositeExtract %int %109 0
|
|
|
|
%111 = OpIEqual %bool %int_n100 %110
|
2021-04-21 18:27:08 +00:00
|
|
|
OpBranch %108
|
|
|
|
%108 = OpLabel
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%112 = OpPhi %bool %false %97 %111 %107
|
|
|
|
OpSelectionMerge %114 None
|
|
|
|
OpBranchConditional %112 %113 %114
|
|
|
|
%113 = OpLabel
|
|
|
|
%116 = OpLoad %v4int %expectedA
|
|
|
|
%117 = OpVectorShuffle %v2int %116 %116 0 1
|
|
|
|
%118 = OpIEqual %v2bool %115 %117
|
|
|
|
%119 = OpAll %bool %118
|
|
|
|
OpBranch %114
|
|
|
|
%114 = OpLabel
|
|
|
|
%120 = OpPhi %bool %false %108 %119 %113
|
|
|
|
OpSelectionMerge %122 None
|
|
|
|
OpBranchConditional %120 %121 %122
|
2021-04-21 18:27:08 +00:00
|
|
|
%121 = OpLabel
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%124 = OpLoad %v4int %expectedA
|
|
|
|
%125 = OpVectorShuffle %v3int %124 %124 0 1 2
|
|
|
|
%126 = OpIEqual %v3bool %123 %125
|
|
|
|
%127 = OpAll %bool %126
|
|
|
|
OpBranch %122
|
|
|
|
%122 = OpLabel
|
|
|
|
%128 = OpPhi %bool %false %114 %127 %121
|
|
|
|
OpSelectionMerge %130 None
|
|
|
|
OpBranchConditional %128 %129 %130
|
|
|
|
%129 = OpLabel
|
|
|
|
%131 = OpLoad %v4int %expectedA
|
|
|
|
%132 = OpIEqual %v4bool %49 %131
|
|
|
|
%133 = OpAll %bool %132
|
|
|
|
OpBranch %130
|
|
|
|
%130 = OpLabel
|
|
|
|
%134 = OpPhi %bool %false %122 %133 %129
|
|
|
|
OpSelectionMerge %136 None
|
|
|
|
OpBranchConditional %134 %135 %136
|
2021-04-21 18:27:08 +00:00
|
|
|
%135 = OpLabel
|
Implement compile-time optimization for clamp().
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, float minVal, float maxVal);
$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
$genHType clamp($genHType x, half minVal, half maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
Change-Id: I726270e84fca781825e59abed0c8c7d099ca7444
Bug: skia:12034
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411839
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-05-25 15:17:43 +00:00
|
|
|
%138 = OpLoad %v4int %intValues
|
|
|
|
%139 = OpCompositeExtract %int %138 0
|
|
|
|
%137 = OpExtInst %int %1 SClamp %139 %int_n100 %int_100
|
|
|
|
%140 = OpLoad %v4int %expectedB
|
|
|
|
%141 = OpCompositeExtract %int %140 0
|
|
|
|
%142 = OpIEqual %bool %137 %141
|
|
|
|
OpBranch %136
|
|
|
|
%136 = OpLabel
|
|
|
|
%143 = OpPhi %bool %false %130 %142 %135
|
|
|
|
OpSelectionMerge %145 None
|
|
|
|
OpBranchConditional %143 %144 %145
|
|
|
|
%144 = OpLabel
|
|
|
|
%147 = OpLoad %v4int %intValues
|
|
|
|
%148 = OpVectorShuffle %v2int %147 %147 0 1
|
|
|
|
%146 = OpExtInst %v2int %1 SClamp %148 %149 %150
|
|
|
|
%151 = OpLoad %v4int %expectedB
|
|
|
|
%152 = OpVectorShuffle %v2int %151 %151 0 1
|
|
|
|
%153 = OpIEqual %v2bool %146 %152
|
|
|
|
%154 = OpAll %bool %153
|
|
|
|
OpBranch %145
|
|
|
|
%145 = OpLabel
|
|
|
|
%155 = OpPhi %bool %false %136 %154 %144
|
|
|
|
OpSelectionMerge %157 None
|
|
|
|
OpBranchConditional %155 %156 %157
|
|
|
|
%156 = OpLabel
|
|
|
|
%159 = OpLoad %v4int %intValues
|
|
|
|
%160 = OpVectorShuffle %v3int %159 %159 0 1 2
|
|
|
|
%158 = OpExtInst %v3int %1 SClamp %160 %161 %162
|
|
|
|
%163 = OpLoad %v4int %expectedB
|
|
|
|
%164 = OpVectorShuffle %v3int %163 %163 0 1 2
|
|
|
|
%165 = OpIEqual %v3bool %158 %164
|
|
|
|
%166 = OpAll %bool %165
|
|
|
|
OpBranch %157
|
|
|
|
%157 = OpLabel
|
|
|
|
%167 = OpPhi %bool %false %145 %166 %156
|
|
|
|
OpSelectionMerge %169 None
|
|
|
|
OpBranchConditional %167 %168 %169
|
|
|
|
%168 = OpLabel
|
|
|
|
%171 = OpLoad %v4int %intValues
|
|
|
|
%172 = OpLoad %v4int %clampLow
|
|
|
|
%173 = OpLoad %v4int %clampHigh
|
|
|
|
%170 = OpExtInst %v4int %1 SClamp %171 %172 %173
|
|
|
|
%174 = OpLoad %v4int %expectedB
|
|
|
|
%175 = OpIEqual %v4bool %170 %174
|
|
|
|
%176 = OpAll %bool %175
|
|
|
|
OpBranch %169
|
|
|
|
%169 = OpLabel
|
|
|
|
%177 = OpPhi %bool %false %157 %176 %168
|
|
|
|
OpSelectionMerge %179 None
|
|
|
|
OpBranchConditional %177 %178 %179
|
|
|
|
%178 = OpLabel
|
|
|
|
%180 = OpLoad %v4int %expectedB
|
|
|
|
%181 = OpCompositeExtract %int %180 0
|
|
|
|
%182 = OpIEqual %bool %int_n100 %181
|
|
|
|
OpBranch %179
|
|
|
|
%179 = OpLabel
|
|
|
|
%183 = OpPhi %bool %false %169 %182 %178
|
|
|
|
OpSelectionMerge %185 None
|
|
|
|
OpBranchConditional %183 %184 %185
|
|
|
|
%184 = OpLabel
|
|
|
|
%186 = OpLoad %v4int %expectedB
|
|
|
|
%187 = OpVectorShuffle %v2int %186 %186 0 1
|
|
|
|
%188 = OpIEqual %v2bool %115 %187
|
|
|
|
%189 = OpAll %bool %188
|
|
|
|
OpBranch %185
|
|
|
|
%185 = OpLabel
|
|
|
|
%190 = OpPhi %bool %false %179 %189 %184
|
|
|
|
OpSelectionMerge %192 None
|
|
|
|
OpBranchConditional %190 %191 %192
|
|
|
|
%191 = OpLabel
|
|
|
|
%194 = OpLoad %v4int %expectedB
|
|
|
|
%195 = OpVectorShuffle %v3int %194 %194 0 1 2
|
|
|
|
%196 = OpIEqual %v3bool %193 %195
|
|
|
|
%197 = OpAll %bool %196
|
|
|
|
OpBranch %192
|
|
|
|
%192 = OpLabel
|
|
|
|
%198 = OpPhi %bool %false %185 %197 %191
|
|
|
|
OpSelectionMerge %200 None
|
|
|
|
OpBranchConditional %198 %199 %200
|
|
|
|
%199 = OpLabel
|
|
|
|
%201 = OpLoad %v4int %expectedB
|
|
|
|
%202 = OpIEqual %v4bool %56 %201
|
|
|
|
%203 = OpAll %bool %202
|
|
|
|
OpBranch %200
|
|
|
|
%200 = OpLabel
|
|
|
|
%204 = OpPhi %bool %false %192 %203 %199
|
|
|
|
OpSelectionMerge %209 None
|
|
|
|
OpBranchConditional %204 %207 %208
|
|
|
|
%207 = OpLabel
|
|
|
|
%210 = OpAccessChain %_ptr_Uniform_v4float %10 %int_1
|
|
|
|
%212 = OpLoad %v4float %210
|
|
|
|
OpStore %205 %212
|
|
|
|
OpBranch %209
|
|
|
|
%208 = OpLabel
|
|
|
|
%213 = OpAccessChain %_ptr_Uniform_v4float %10 %int_2
|
|
|
|
%215 = OpLoad %v4float %213
|
|
|
|
OpStore %205 %215
|
|
|
|
OpBranch %209
|
|
|
|
%209 = OpLabel
|
|
|
|
%216 = OpLoad %v4float %205
|
|
|
|
OpReturnValue %216
|
Implement additional Runtime Effect intrinsic tests.
Tested in dm:
- max(halfN, halfN)
- max(halfN, half)
- min(halfN, halfN)
- min(halfN, half)
- clamp(halfN, halfN, halfN)
- clamp(halfN, half, half)
- mix(halfN, halfN, halfN)
- mix(halfN, halfN, half)
Compiled outputs only (not in ES2):
- max(intN, intN)
- max(intN, int)
- min(intN, intN)
- min(intN, int)
- clamp(intN, intN, intN)
- clamp(intN, int, int)
- mix(halfN, halfN, boolN) - broken in Metal/SPIR-V (skia:11222)
- mix(intN, intN, boolN) - broken in Metal/SPIR-V (skia:11222)
Change-Id: Iaafc5429b16d2a8710b9d171ae281c268c0fd70d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361438
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-29 16:51:47 +00:00
|
|
|
OpFunctionEnd
|