CPC G06T 15/005 (2013.01) [G06T 1/20 (2013.01); G06T 15/80 (2013.01); G06V 10/751 (2022.01)] | 9 Claims |
1. A shader auto-simplifying method based on a rendering instruction flow, wherein the method comprises:
obtaining a rendering instruction flow, extracting a target shader from the rendering instruction flow, and creating a simplifying shader differing from the target shader in code only;
intercepting a current frame of a rendering instruction comprising a rendering initiating instruction of the target shader as a particular frame;
obtaining time consumed by the simplifying shader by measuring time needed for rendering the particular frame with the simplifying shader;
obtaining error(s) of the simplifying shader by measuring a pixel difference value between a rendering frame drawn by the simplifying shader and the particular frame when a rendering instruction corresponding to the particular frame is executed; and
screening an optimal simplifying shader according to the time consumed by the simplifying shader and the error of the simplifying shader;
wherein the obtaining process of the particular frame comprises:
upon executing the rendering instruction flow, employing an instruction of an exchange buffer area to distinguish an adjacent frame and obtaining a rendering instruction set corresponding to a current frame; and
if the rendering instruction set corresponding to the current frame comprises a rendering initiating instruction using the target shader, taking the current frame as a particular frame.
|