Add program-too-large test using for loops without blocks.
The fuzzer has discovered a bug in our program size-checking logic; for loops that immediately contain another for loop (with no block) were not counting the inner loop's iterations. This allowed it to exceed our maximum program-size threshold (and time out during SkVM compilation). This test demonstrates the issue. A followup will fix it. Change-Id: I3b7d4c8a4f0ed04cf0aba3f1a32fdad7d6d784e7 Bug: oss-fuzz:37837 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449096 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> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
parent
8a05251321
commit
857c7f9dc5
@ -540,6 +540,7 @@ sksl_rte_tests = [
|
||||
"/sksl/runtime/ConversionConstructors.rts",
|
||||
"/sksl/runtime/GLSLTypeNames.rts",
|
||||
"/sksl/runtime/GlobalVariables.rts",
|
||||
"/sksl/runtime/LargeProgram_BlocklessLoops.rts",
|
||||
"/sksl/runtime/LargeProgram_FlatLoop.rts",
|
||||
"/sksl/runtime/LargeProgram_Functions.rts",
|
||||
"/sksl/runtime/LargeProgram_NestedLoops.rts",
|
||||
@ -577,6 +578,7 @@ sksl_rte_error_tests = [
|
||||
"/sksl/runtime_errors/LoopStructureErrors.rts",
|
||||
"/sksl/runtime_errors/Ossfuzz36655.rts",
|
||||
"/sksl/runtime_errors/Ossfuzz38131.rts",
|
||||
"/sksl/runtime_errors/ProgramTooLarge_BlocklessLoops.rts",
|
||||
"/sksl/runtime_errors/ProgramTooLarge_FlatLoop.rts",
|
||||
"/sksl/runtime_errors/ProgramTooLarge_Functions.rts",
|
||||
"/sksl/runtime_errors/ProgramTooLarge_NestedLoops.rts",
|
||||
|
11
resources/sksl/runtime/LargeProgram_BlocklessLoops.rts
Normal file
11
resources/sksl/runtime/LargeProgram_BlocklessLoops.rts
Normal file
@ -0,0 +1,11 @@
|
||||
half4 main(float2 xy) {
|
||||
int i;
|
||||
|
||||
for (int a=0; a<10; ++a) // 10
|
||||
for (int b=0; b<10; ++b) // 100
|
||||
for (int c=0; c<10; ++c) // 1000
|
||||
for (int d=0; d<10; ++d) // 10000
|
||||
++i;
|
||||
|
||||
return half4(0);
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
half4 main(float2 xy) {
|
||||
int i;
|
||||
|
||||
for (int a=0; a<10; ++a) // 10
|
||||
for (int b=0; b<10; ++b) // 100
|
||||
for (int c=0; c<10; ++c) // 1000
|
||||
for (int d=0; d<10; ++d) // 10000
|
||||
for (int e=0; e<10; ++e) // 100000
|
||||
++i;
|
||||
|
||||
return half4(0);
|
||||
}
|
7
tests/sksl/runtime/LargeProgram_BlocklessLoops.skvm
Normal file
7
tests/sksl/runtime/LargeProgram_BlocklessLoops.skvm
Normal file
@ -0,0 +1,7 @@
|
||||
1 registers, 5 instructions:
|
||||
0 r0 = splat 0 (0)
|
||||
loop:
|
||||
1 store32 ptr1 r0
|
||||
2 store32 ptr2 r0
|
||||
3 store32 ptr3 r0
|
||||
4 store32 ptr4 r0
|
6
tests/sksl/runtime/LargeProgram_BlocklessLoops.stage
Normal file
6
tests/sksl/runtime/LargeProgram_BlocklessLoops.stage
Normal file
@ -0,0 +1,6 @@
|
||||
half4 main(float2 xy)
|
||||
{
|
||||
int i;
|
||||
for (int a = 0;a < 10; ++a) for (int b = 0;b < 10; ++b) for (int c = 0;c < 10; ++c) for (int d = 0;d < 10; ++d) ++i;
|
||||
return half4(half4(0.0));
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
1 registers, 5 instructions:
|
||||
0 r0 = splat 0 (0)
|
||||
loop:
|
||||
1 store32 ptr1 r0
|
||||
2 store32 ptr2 r0
|
||||
3 store32 ptr3 r0
|
||||
4 store32 ptr4 r0
|
Loading…
Reference in New Issue
Block a user