Patent Document ID: 9390542
Application ID: 14076886
Patent Status: 1

Claim One:
1. One or more computer-storage memory having computer-executable instructions embodied thereon for executing a method allocating memory registers to shader instances, the method comprising: declaring one or more interfaces to define a shader template, wherein one or more classes of a shader depend from the one or more interfaces; defining a simple shader definition and a complex shader definition; defining a variable in a shader program for inlining an actual shader instance; at a point in the shader program where the one or more interfaces are used, inlining instances of the simple shader definition and the complex shader definition; providing a graphics processing unit (GPU) driver with one or more tables defining usage points and indicating definitions of the simple shader definition and the complex shader definition; upon execution, choosing either an instance of the simple shader definition or an instance of the complex shader definition; and allocating memory for the actual shader instance, wherein a number of registers associated with the memory and allocated for the actual shader instance depends on a level of complexity for the actual shader instance, wherein a greater number of registers is allocated when the actual shader instance is a complex shader instance, and a lesser number of registers is allocated when the actual shader instance is a simple shader instance.