Emit SkVM function bodies with writeBlock.

`writeStatement` has the potential to emit a trace_line op. In practice,
right now our function's outer Block never has a position, so there is
no difference. However, Ethan's position-related work will add a
position to this Block, which would expose this issue and break tests.

Change-Id: I810edbc9b82feafd471cbcacf062aa14c8a66ba8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527841
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This commit is contained in:
John Stiles 2022-04-05 17:20:40 -04:00 committed by SkCQ
parent be405a8b38
commit 71c7f7961d

View File

@ -570,7 +570,7 @@ size_t SkVMGenerator::writeFunction(const IRNode& caller,
}
SkASSERT(argIdx == arguments.size());
this->writeStatement(*function.body());
this->writeBlock(function.body()->as<Block>());
// Copy 'out' and 'inout' parameters back to their caller-supplied argument storage
argIdx = 0;