skia2/tests/sksl/runtime/LargeProgram_StackDepth.skvm
John Stiles 2af4b13925 Reject programs which exceed 50 stack frames during size analysis.
Our program-size analysis pass needs to recurse into called functions;
depending on the exact order of functions in the program, this recursion
can hypothetically be as deep as the deepest function-call chain. Set an
upper bound on recursion here, so we don't overflow the stack while
trying to check the program size. In practice, 50 frames is far deeper
than a regular shader should ever go.

Change-Id: I733ee48dad6f8053facdfd9f6d8a2b9b2a4af188
Bug: skia:12396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445279
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-03 02:41:34 +00:00

8 lines
149 B
Plaintext

1 registers, 5 instructions:
0 r0 = splat 3F800000 (1)
loop:
1 store32 ptr1 r0
2 store32 ptr2 r0
3 store32 ptr3 r0
4 store32 ptr4 r0