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 the instance of the simple shader definition or the instance of the complex shader definition; and allocating memory for the shader instance, wherein a number of registers associated with the memory and allocated for the shader instance depends on a level of complexity for the shader instance.