发明名称 Run-time optimized shader program
摘要 Systems, methods, and computer readable media for generating optimized shader programs (e.g., vertex and fragment) at run-time are described. In general, techniques are disclosed for determining when an executing graphics program (a “client”) issues a command that, to be carried out, would require a significant change in the currently executing shader program (a “shader”). When this is detected, the client's specified change may be used to identify a minimal set of shader instructions that can provide the client's designated effect. The instructions so identified, may be used to generate a shader optimized for that effect.
申请公布号 US9412193(B2) 申请公布日期 2016.08.09
申请号 US201113151174 申请日期 2011.06.01
申请人 Apple Inc. 发明人 Rosasco John D.
分类号 G06T15/00;G06F9/455 主分类号 G06T15/00
代理机构 Blank Rome LLP 代理人 Blank Rome LLP
主权项 1. A method to generate optimized shader programs at run-time, comprising: receiving a designated graphics effect from an application at run-time, the designated graphics effect being represented as a mask including a pattern of bits; determining a change in a number or a sequence of instructions of a currently instantiated shader program is needed to perform the designated graphics effect; in response to the determined need, determining whether an optimized shader program capable of performing the designated graphics effect is stored in memory; obtaining the optimized shader program from memory when the optimized shader program is determined to be in memory; preparing the optimized shader program when the optimized shader program is not stored in memory, the preparing of the optimized shader program including: automatically applying the mask to the currently instantiated shader program, removing shader program source instructions of the currently instantiated shader program that fail to correspond to the pattern of bits, designating unremoved shader program source instructions as one or more identified shader program source instructions, and automatically compiling only the one or more identified shader program source instructions to generate the optimized shader program; andexecuting the optimized shader program.
地址 Cupertino CA US