US 12,094,049 B2
Shader auto-simplifying method and system based on rendering instruction flow
Hujun Bao, Hangzhou (CN); Rui Wang, Hangzhou (CN); Dejin He, Hangzhou (CN); and Shi Li, Hangzhou (CN)
Assigned to ZHEJIANG UNIVERSITY, Hangzhou (CN)
Appl. No. 17/626,786
Filed by ZHEJIANG UNIVERSITY, Hangzhou (CN)
PCT Filed Oct. 21, 2020, PCT No. PCT/CN2020/122601
§ 371(c)(1), (2) Date Jan. 12, 2022,
PCT Pub. No. WO2021/129087, PCT Pub. Date Jul. 1, 2021.
Claims priority of application No. 201911376430.2 (CN), filed on Dec. 27, 2019.
Prior Publication US 2022/0254089 A1, Aug. 11, 2022
Int. Cl. G06T 15/00 (2011.01); G06T 1/20 (2006.01); G06T 15/80 (2011.01); G06V 10/75 (2022.01)
CPC G06T 15/005 (2013.01) [G06T 1/20 (2013.01); G06T 15/80 (2013.01); G06V 10/751 (2022.01)] 9 Claims
OG exemplary drawing
 
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.