Application binary interface for multi-pass shaders

-

An application binary interface includes a descriptor specifying a binary shader for each pass of a multi-pass shader. The application binary interface also includes a graphics state of a graphics object for each pass of the multi-pass shader. The graphics state for the first pass is an initial graphics state of the graphics object. The graphics state for each subsequent pass specifies a change from the graphics state of a previous pass. The application binary interface further includes parameters for the binary shaders. The application binary interface links the binary shaders together based on the parameters. Further, the parameters of the binary shaders may be modified at run time to configure the multi-pass shader. The binary shader of each pass is then executed based on the graphics state and parameters of the pass to render the graphics object.

Skip to: Description  ·  Claims  · Patent History  ·  Patent History
Description
BACKGROUND

1. Field of the Invention

The present invention relates generally to computer graphics. More particularly, the present invention relates to systems and methods of controlling precompiled computer programs in computer graphics systems.

2. Background Art

Prior art computer graphics systems typically execute an application program, such as a computer video game program, to generate graphics images for display on a computer screen. One type of prior art computer graphics system includes an on-line compiler. In this type of computing system, the computer graphics system compiles portions of the application program while executing other portions of the application program in real time. In this way, a first portion of the application program executing in the computer graphics system can provide run time parameters for compiling a second portion of the application program.

In some situations, a portion of the application program written specifically for graphics hardware in the computer graphics system can be simplified by using run time parameters during compilation. For instance, a first portion of the application program may include a loop construct having a loop count parameter, and the compiler can unroll the loop construct based on a value of the loop count parameter provided by a second portion of the application program at run time. Including a compiler in the computer graphics system, however, increases the cost and complexity of the graphics computer system.

Another type of prior art computer graphics system executes precompiled application programs. In this type of computer graphics system, an application program is compiled into binary programs by using an off-line compiler. The binary programs are then provided to the computer graphics system, which executes the binary programs. Precompiling the application program avoids the need for an on-line compiler but may complicate portions of the application program written specifically for graphics hardware in the computer graphics system. Specifically, these portions of the application program may require fixed parameters at compile time.

One type of program typically found in an application program written for a computer graphics systems is a shader. A shader generates visual effects for graphics objects. In many computer graphics systems, the shader controls multiple texture units in the graphics hardware, each of which can access samples from a texture. Moreover, the shader generates colors for the graphics object based on the textures accessed from the texture units.

Some shaders require a greater number of textures for creating a visual effect than the number of texture units available in the graphics hardware of a computer graphics system. Consequently, some compilers cannot compile these application programs for these computer graphics systems. Other compilers generate a multi-pass shader by breaking up the task of creating a visual effect into passes such that each pass requires no more texture units than the number of texture units available in the computer graphics system. Each pass of the multi-pass shader performs an operation on a graphics to generate a result. In this way, a pass of the multi-pass shader may perform an operation based on a result generated in a previous pass.

In those types of computer graphics systems that compile programs on-line, an application program can modify parameters of a shader to configure the shader at run time, which may simplify the task of programming the shader. In contrast, those computer graphics systems that rely on an off-line compiler may need to fix some parameters of the shader at the time of compilation (i.e., compile time). Consequently, the shader (i.e., the precompiled shader) is not configurable at run time, which may complicate the task of programming the shader.

In light of the above, there exists a need to simplify the task of programming a multi-pass shader. Additionally, these exists a need for a precompiled multi-pass shader that is configurable at run time.

SUMMARY OF THE INVENTION

An application binary interface addresses the need for simplifying the task of programming a multi-pass shader. Further, the application binary interface addresses the need for a precompiled multi-pass shader that is configurable at run time. For each pass of a multi-pass shader, the application binary interface specifies a binary shader, one or more parameters for the binary shader, and a graphics state. The graphics state for a first pass specifies an initial graphics state of a graphics object, and the graphics state of each subsequent pass specifies a change from the graphics state of a previous pass. The parameters link the binary shaders together so that a binary shader of a given pass can use a result generated by a binary shader of a previous pass. The binary application interface simplifies the task of programming the multi-pass shader by specifying the binary shaders, parameters for the binary shaders, and graphics states for the multi-pass shader in a binary file.

In one embodiment, a binary application program determines the binary shaders, parameters, and graphics states for the multi-pass shader based on the binary application interface. Further, the application program can modify the parameters of the application binary interface at run time to configure the multi-pass shader. The binary shader for each pass is then executed based on the parameters of the binary shader and the graphics state of the pass to render the graphics object.

The application binary interface, in accordance with one embodiment of the present invention, includes a descriptor for each pass of a multi-pass shader that specifies a binary shader for the pass. The binary application interface also includes one or more parameters for each binary shader. Further, the binary application interface includes a graphics state for each pass.

A system for generating an application binary interface, in accordance with one embodiment of the present invention includes a memory system that stores a computer program for rendering a graphics object and a compiler. The system further includes a computing processor that executes the compiler on the computer program to generate an application binary interface. The application binary interface includes a descriptor for each pass of the multi-pass shader that specifies a binary shader of the pass. The application binary interface also includes one or more parameters for the binary shader of each pass and a graphics state of each pass.

In a method of rendering a graphics object, in accordance with one embodiment of the present invention, a binary shader and a graphics state of a first pass of a multi-pass shader are identified based on an application binary interface. The binary shader of the first pass is then executed based on the graphics state of the first pass to generate a result for the first pass. A binary shader and a graphics state of a second pass of the multi-pass shader are also identified based on the application binary interface. The binary shader of the second pass is then executed based on the graphics state of the second pass and the result of the first pass to generate a result for the second pass. This process may then be repeated for any additional passes. In one embodiment, the result of a final pass is a color of the graphics object.

A system for rendering a graphics object, in accordance with the present invention, includes a computing processor that identifies both a binary shader and a graphics state of a first pass of a multi-pass shader based on an application binary interface. The computing processor also identifies both a graphics state and a binary shader of a second pass of the multi-pass shader based on the application binary interface. The system further includes a graphics processor that executes the binary shader of the first pass based on the graphics state of the first pass to generate a result for the first pass. Additionally, the graphics processor executes the binary shader of the second pass based on the graphics state of the second pass and the result of the first pass to generate a result for the second pass. This process may then be repeated for any additional passes. In one embodiment, the result of a final pass is a color of the graphics object.

A computer program product for rendering a graphics object, in accordance with the present invention, includes computer program code for identifying both a binary shader and a graphics state of a first pass of a multi-pass shader based on an application binary interface, and executing the binary shader of the first pass based on the graphics state of the first pass to generate a result for the first pass. The computer program product further includes computer program code for identifying both a binary shader and a graphics state of a second pass of the multi-pass shader based on the application binary interface, and executing the binary shader of the second pass based on the graphics state of the second pass and the result of the first pass to generate a result for the second pass. This process may then be repeated for any additional passes. In one embodiment, the result of a final pass is a color of the graphics object.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an exemplary computing environment, in accordance with one embodiment of the present invention;

FIG. 2 is a block diagram of the exemplary computing system of FIG. 1;

FIG. 3 is a block diagram of the exemplary computer graphics system of FIG. 1;

FIG. 4 is a block diagram of the exemplary graphics pipeline of FIG. 3;

FIG. 5 is a block diagram of the exemplary application program of FIG. 1;

FIG. 6 is a block diagram of the exemplary binary program of FIG. 1;

FIG. 7 is a flow chart for a method of generating an application binary interface, in accordance with one embodiment of the present invention; and

FIG. 8 is a flow chart for a method of rendering a graphic object by using an application binary interface, in accordance with one embodiment of the present invention.

DETAILED DESCRIPTION OF THE EMBODIMENTS

According to one embodiment of the present invention, an application binary interface includes a descriptor for each pass of a multi-pass shader specifying a binary shader for the pass. The application binary interface also includes one or more parameters for the binary shader of each pass. Further, the application binary interface includes a graphics state of each pass. The graphics state of the first pass is an initial graphics state of a graphics object, and the graphics state of each subsequent pass specifies a change from the graphics state of a previous pass. The parameters link the binary shaders together such that a binary shader of a given pass can use a result generated by a binary shader of a previous pass. The binary shader of each pass is then executed based on the graphics state and the parameters of the pass to render the graphics object.

FIG. 1 depicts an exemplary computing environment 100 in accordance with one embodiment of the present invention. The exemplary computing environment 100 includes a computing system 105 and a computer graphics system 120. The exemplary computer system 105 includes a computer program 110, a compiler 115, and a binary program 125. In operation, the computing system 105 executes the compiler 115 on the computer program 110 to generate the binary program 125. The binary program 125 is then provided to the computer graphics system 120. The computer graphics system 120 executes the binary program 125 and renders graphics images based on the binary program 125.

In one embodiment, the computer program 110 is a video game program. In this embodiment, the computer graphics system 120 executes the binary program 125 to render graphics images for the video game program. In another embodiment, the computer system 105 includes the computer graphics system 120.

FIG. 2 depicts the exemplary computing system 105 of FIG. 1. The exemplary computing system 105 includes a computing processor 200, input-output (I/O) device(s) 215, and a memory system 220 coupled in communication with each other via a communication bus 205. The memory system 220 stores the computer program 110 and the compiler 115. The computing processor 200 executes the compiler 115 on the computer program 110 to generate the binary program 125 and provides the binary program to the I/O device(s) 215.

In one embodiment, the binary program 125 includes computer program code stored on a compact disc read-only memory (CD-ROM). In another embodiment, the binary program 125 includes computer program code stored on a digital versatile disc (DVD). In still another embodiment, the binary program 125 includes computer program code stored on a portable memory device, such as a flash memory device.

FIG. 3 depicts the exemplary computer graphics system 120 of FIG. 1. The exemplary computer graphics system 120 includes input-output (I/O) device(s) 305, a computing processor 300, a memory system 320, and a graphics processor 325 coupled in communication with each other via a communication bus 315. In this embodiment, the I/O device(s) 305 receives the binary program 125 and the computing processor 300 stores the binary program 125 into the memory system 320. The computing processor 300 and the graphics processor 325 then execute various portions of the binary program 125 stored in the memory system 320 to render graphics images, as is described more fully herein.

FIG. 4 is a block diagram of the exemplary graphics processor 300 of FIG. 3. In this embodiment, the graphics processor 325 includes a graphics pipeline 400. The graphics pipeline 400 includes a transform unit 405, a raster unit 410, a texture unit 415, and a frame buffer 420. The transform unit 405 executes a vertex program to transform a graphics object into graphics primitives defined by vertices, such as lines and triangles. The raster unit 410 transforms the graphics primitives into pixels and generates a value for each pixel. Optionally, the texture unit 415 accesses samples from one or more textures and provides data based on the samples to the raster unit 410. In turn, the raster unit 410 generates the value for each pixel based on the data received from the texture unit 415. The frame buffer 420 stores the value of each pixel in the graphics object. In one embodiment, the value of each pixel represents a color of the pixel. In a further embodiment, the frame buffer 420 stores the value of each pixel in a graphics image composed of multiple graphics objects.

In one embodiment, the graphics pipeline 400 includes a plurality of texture units 415, each of which can access one or more textures. In this embodiment, each texture unit 415 concurrently generates an intermediate value for each pixel based on the texture accessed by the texture unit 415, and the raster unit 410 combines the intermediate values of the pixel to generate the value of the pixel. In another embodiment, the value of the pixel represents a color of the pixel.

FIG. 5 depicts the exemplary computer program 110 of FIG. 1. The computer program 110 includes an application 500 (i.e., application program) and a shader 505 (i.e., a shader program). The shader 505 includes computing instructions for rendering a graphics object, and the application 500 includes instructions for invoking the shader 505 to render a graphics object. Further, the application 500 can include instructions for invoking multiple shaders 505 to render multiple graphics objects for a graphics image.

FIG. 6 depicts the exemplary binary program 125 of FIG. 1. The binary program 125 includes a binary application 600 (i.e., a binary application program), one or more binary shaders 605 (i.e., binary shader programs) and an application binary interface 610. In this embodiment, the application binary interface 610 includes a descriptor for specifying a binary shader, one or more parameters for the binary shader, and a graphics state for each pass of a multi-pass shader. The graphics state of the first pass is an initial graphics state for a graphics object. The graphics state of each subsequent pass specifies a change from the graphics state of the previous pass. The parameters link the binary shaders together so that the binary shader of a given pass can use a result generated by the binary shader of a previous pass. For example, an input parameter of the binary shader of the given pass can be an output parameter of the binary shader of the previous pass. In this way, the passes of the multi-pass shader can be executed to render the graphics object. In a further embodiment, the passes of the multi-pass shaders are arranged in serial form. In this embodiment, a subsequent pass of the multi-pass shaders follows a previous pass of the multi-pass shader.

In one embodiment, the compiler 115 (FIG. 1) compiles the shader 505 (FIG. 5) to generate an expression for rendering a graphics object. Subsequently, the compiler 115 identifies subexpressions in the expression such that each subexpression can be executed by the graphics processor 325 (FIG. 3) in a single pass. The compiler 115 then generates the binary shader 605, one or more parameters for the binary shader, and the graphic state for each subexpression. In this embodiment, the graphics states link the binary shaders 605 together so that the graphics processor 325 can execute the binary shaders 605 to render the graphics object. For example, a binary shader 605 can store data in a location (e.g., a texture unit or frame buffer) in the graphics processor 325 and a graphics state can specify that location. Another binary shader 605 can then determine the location of the data based on the graphics state.

In another embodiment, a graphics state can specify characteristics of the computer graphics system 120 (FIG. 3) or a graphics image. For example, the graphics state can specify a number of texture units available in the graphics processor 325. As another example, the graphics state can specify a pixel size of the graphics image. In still another example, the graphics state can specify a texture program to be executed by the graphics processor 325 on the graphics object.

According to an exemplary embodiment, the application 500 (FIG. 5) includes computing instructions for invoking a shader 505 via the application binary interface 610. In this embodiment, the computing instructions include one or more variables, each of which corresponds to a parameter in the application binary interface 610. Consequently, the binary application 600 can determine the value of a variable and bind the value of the variable to the corresponding parameter at run time. In this way, the binary application 600 configures a multi-pass shader at run time based on the value of the variable.

In another embodiment, the value of a variable is limited to a predetermined set of values in the application 500. In this embodiment, the compiler 115 generates a binary shader 605 for each value in the predetermined set by setting the parameter to the value. In this way, the parameter of each binary shaders 605 is fixed at compile time. The binary application 600 then determines the value of the variable at run time to select the binary shader 605 identified by the value of the variable. In this way, the binary application 600 configures a multi-pass shader at run time based on the value of the variable.

A representation of a shader, a multi-pass shader, and an exemplary application binary interface 610 for the multi-pass shader is depicted in Table 1. As depicted in Table 1, the shader is represented by the expression “output=cosine (texture_lookup(x,y))” in which “x” and “y” are input parameters and “output” represents an output value of the shader. The first pass of the multi-pass shader is represented by the subexpression “tmp=texture_lookup (x, y)” and the second pass is represented by the subexpression “output=cosine (tmp).” In the first pass, “x” and “y” are input parameters and “tmp” represents an output value of the first pass. In the second pass, “tmp” is an input parameter and “output” represents an output value of the second pass.

As is also depicted in table 1, the application binary interface 610 specifies the first pass and the second pass of the multi-pass shader. For the first pass, a descriptor is represented by “texture_lookup”, which identifies a binary shader for the first pass. Further, input parameters for the binary shader of the first pass are represented by “x” and “y”, and an output parameter for the binary shader of the first pass is represented by “tmp”. The output parameter “tmp” represents an output value for the binary shader of the first pass. Further, in this embodiment, the output value for the binary shader of the first pass is a result for the first pass. Additionally, an initial graphics state for a graphics object is represented by “texture unit 1”, which specifies that a first texture unit will access a texture for the binary shader of the first pass.

For the second pass, a descriptor is represented by “cosine”, which represents a binary shader for the second pass. Further, an input parameter for the binary shader of the second pass is represented by “tmp”, which is the output parameter of the first pass. Accordingly, the input parameter “tmp” for the binary shader of the second pass represents the output value of the binary shader of the first pass. Additionally, a graphics state of the second pass is represented by “frame buffer”, which specifies that the result of the second pass will be stored in a frame buffer. In this way, the graphics state of the second pass specifies a change from the graphics state of the first pass. Further, the parameter “tmp” links the binary shader of the second pass to the binary shader of the first pass such that the result of the first pass is an input parameter for the binary shader of the second pass. The output parameter “output” represents an output value for the binary shader of the second pass. Further, in this embodiment, the output value for the binary shader of the second pass is a result for the second pass.

TABLE 1 shader output = cosine (texture_lookup (x, y)) multi-pass shader first pass: tmp = texture_lookup (x, y) second pass: output = cosine (tmp) application binary interface first pass: descriptor = texture_lookup input parameter(s) = x, y output parameter(s) = tmp graphics state = texture unit 1 second pass: descriptor = cosine input parameter(s) = tmp output parameter(s) = output graphics state = frame buffer

FIG. 7 depicts a flow chart for a method 700 of generating the application binary interface 610 (FIG. 6), in accordance with one embodiment of the present invention. In step 705, the compiler 115 (FIG. 1) compiles the shader 505 (FIG. 5) to generate a first binary shader 605 (FIG. 6) and a first graphics state for a first pass of a multi-pass shader. In one embodiment, the compiler 115 compiles the application 500 (FIG. 5) together with the shader 505 to generate the first binary shader 605. It is to be appreciated that step 705 is optional in the present invention.

In step 710, the compiler 115 compiles the shader 505 to generate the next binary shader 605 and the next graphics state for the next pass of a multi-pass shader. In one embodiment, the compiler 115 compiles the application 500 together with the shader 505 to generate the binary shader 605 and the graphics state for this next pass. It is to be appreciated that step 710 is optional in the present invention.

In another embodiment, the compiler 115 performs steps 705 and 710 concurrently to generate the binary shader 605 and the graphics state for each pass of the multi-pass shader. In a further embodiment, the compiler 115 also generates the binary application 600 (FIG. 6).

In step 715, the compiler 115 determines whether the multi-pass shader includes additional passes. If the multi-pass shader includes additional passes, the method returns to step 710, otherwise the method proceeds to step 720. It is to be appreciated that step 715 is optional in the present invention.

In step 720, the compiler 115 generates a descriptor and one or more parameters for the first pass of the multi-pass shader. The descriptor of the first pass specifies the first binary shader. In one embodiment, the compiler 115 binds at least one parameter of the first pass to the first binary shader 605 at compile time. In another embodiment, the binary application 600 (FIG. 6) binds at least one parameter of the first pass to the first binary shader 605 at run time. In still another embodiment, the compiler 115 binds some of the parameters of the first pass to the first binary shader 605 at compile time and the binary application 600 binds some of the parameters of the first pass to the first binary shader 605 at run time.

In step 725, the compiler 115 generates a descriptor and one or more parameters for the next pass of the multi-pass shader. The descriptor of this pass specifies the binary shader of this pass. In one embodiment, the compiler 115 binds at least one parameter of this pass to the binary shader 605 of this pass at compile time. In another embodiment, the binary application 600 binds at least one parameter of this pass to the binary shader 605 at run time. In still another embodiment, the compiler 115 binds some of the parameters of this pass to the binary shader at compile time and the binary application 605 binds some of the parameters of this pass to the binary shader at run time.

In step 730, the compiler 115 determines whether the multi-pass shader includes additional passes. If the multi-pass shader includes additional passes, the method returns to step 725, otherwise the method ends. It is to be appreciated the application binary interface 610 comprises the parameter(s) generated for each pass of the multi-pass shader.

In one embodiment, the compiler 115 can perform steps 720-730 concurrently to generate the parameters(s) for each pass of the multi-pass shader. In another embodiment of the present invention, the compiler 115 can perform steps 705-730 concurrently to generate the binary shader 605, the graphics state, and the parameter(s) for each pass of the multi-pass shader. In a further embodiment, the compiler can also generate the binary application 600. In still another embodiment, the compiler 115 can perform steps 705 and 720 concurrently. In yet another embodiment, the compiler can perform steps 710 and 725 concurrently.

FIG. 8 depicts a flow chart for a method 800 of rendering a graphics object by using the application binary interface 610 (FIG. 6), in accordance with one embodiment of the present invention. In step 805, the binary application 600 (FIG. 6) configures a multi-pass shader. In one embodiment, the binary application 600 modifies at least one parameter of the application binary interface 610 at run time (i.e. during execution of the binary application 600) to configure the multi-pass shader. In another embodiment, the binary application 600 configures the multi-pass shader by selecting an application binary interface 610 among multiple application binary interfaces 610 based on one or more parameters at run time. It is to be appreciated that step 805 is optional in the present invention.

In step 810, the binary application 600 identifies the binary shader 605 (FIG. 6) and the graphics state for a first pass of a multi-pass shader based on the application binary interface 610. In one embodiment, the descriptor of the first pass specifies the binary shader 605 of the first pass. In this embodiment, the binary application 600 identifies the binary shader 605 of the first pass based on the descriptor of the first pass. In another embodiment, the descriptor specifies a plurality of binary shaders 605. In this embodiment, the binary application 600 selects the binary shader 605 of the first pass from the plurality of binary shaders 605 at run time based on one or more parameters for the binary shader 605 of the first pass in the application binary interface 610.

In step 815, the graphics processor 325 executes the first pass of the multi-pass shader by executing the first binary shader 605 based on the first graphics state to generate a result for the first pass. In one embodiment, the result for the first pass is a value of each pixel in the graphics object. In a further embodiment, the graphics processor 325 (FIG. 3) includes multiple texture units, each of which can access a texture. In this further embodiment, the graphics processor 325 executes the first binary shader on the multiple texture units in the graphics processor 325 to generate the value for each pixel based on the textures accessed by the texture units.

In step 820, the binary application 600 identifies the binary shader 605 and the graphics state for the next pass of the multi-pass shader based on the application binary interface 610. In one embodiment, the descriptor of this pass specifies the binary shader 605 of the pass. In this embodiment, the binary application 600 identifies the binary shader 605 of this pass based on the descriptor of this pass. In another embodiment, the descriptor specifies a plurality of binary shaders 605. In this embodiment, the binary application 600 selects the binary shader 605 of this pass from the plurality of binary shaders 605 at run time based on one or more parameters for the binary shader 605 of this pass in the application binary interface 610. In a further embodiment, some or all of the parameters for the binary shader 605 of this pass may be a result of a previous pass.

In step 825, the graphics processor 325 executes this next pass of the multi-pass shader by executing the binary shader 605 based on the graphics state to generate a result for this pass. In one embodiment, the result for this pass is a value of each pixel in the graphics object. In a further embodiment, the graphics processor 325 includes multiple texture units, each of which can access a texture. In this further embodiment, the graphics processor 325 executes the binary shader on the multiple texture units in the graphics processor 325 to generate the value for each pixel based on the textures accessed by the texture units.

In another embodiment, the graphics processor 325 generates the value of each pixel based on the value of the pixel generated in a previous pass. In this embodiment, the graphics state of this pass specifies the texture unit storing the intermediate color of each pixel generated in the previous pass. Consequently, the binary shader 605 of the current pass can access the value of the pixel generated in the previous pass to generate the value of the pixel for this pass. In a further embodiment, the value of the pixel generated for the last pass of the multi-pass shader is a color of the pixel. In another further embodiment, the graphics processor 325 stores the value of each pixel for each pass into the frame buffer 420 (FIG. 4) and then combines the values of each pixel to generate a color for the pixel in the frame buffer 420.

In step 830, the binary application 600 determines whether the multi-pass shader includes an additional pass based on the application binary interface 610. If the multi-pass shader includes an additional pass, the method returns to step 820, otherwise the method ends.

The embodiments discussed herein are illustrative of the present invention. As these embodiments of the present invention are described with reference to illustrations, various modifications or adaptations of the methods and/or specific structures described may become apparent to those skilled in the art. All such modifications, adaptations, or variations that rely upon the teachings of the present invention, and through which these teachings have advanced the art, are considered to be within the spirit and scope of the present invention. Hence, these descriptions and drawings should not be considered in a limiting sense, as it is understood that the present invention is in no way limited to only the embodiments illustrated.

Claims

1. An application binary interface for a multi-pass shader comprising a plurality of passes, the application binary interface comprising:

a descriptor for each pass of the plurality of passes for specifying a binary shader of the pass;
at least one parameter for the binary shader of each pass; and
a graphics state of each pass.

2. The application binary interface of claim 1, wherein the plurality of passes are arranged in series, and the graphics state of a subsequent pass specifies a change from the graphics state of a previous pass.

3. The application binary interface of claim 1, wherein the plurality of passes comprises a first pass and a second pass, the at least one parameter for the binary shader of the first pass comprises an output parameter, and the at least one parameter for the binary shader of the second pass comprises an input parameter, the input parameter for the binary shader of the second pass being the output parameter for the binary shader of the first pass.

4. The application binary interface of claim 1, wherein the graphics state of a first pass of the plurality of passes is an initial graphics state for a graphics object.

5. The application binary interface of claim 4, wherein the graphics state of a second pass of the plurality of passes specifies a change from the graphics state of the first pass.

6. The application binary interface of claim 1, wherein the descriptor of each pass specifies the binary shader of the pass.

7. The application binary interface of claim 1, wherein the descriptor of each pass specifies a plurality of binary shaders, and the at least one parameter for the binary shader of the pass identifies the binary shader of the pass from the plurality of binary shaders.

8. The application binary interface of claim 7, wherein the at least one parameter for the binary shader of each pass is modifiable at run time to configure the multi-pass shader.

9. The application binary interface of claim 1, wherein the application binary interface is a binary file.

10. A system for generating an application binary interface for a multi-pass shader comprising a plurality of passess, the system comprising:

a memory system configured to store a computer program for rendering a graphics object, the memory system further configured to store a compiler; and
a computing processor configured to execute the compiler on the computer program to generate an application binary interface comprising a descriptor for each pass of the plurality of passes for specifying a binary shader of the pass, at least one parameter for the binary shader of each pass, and a graphics state of each pass.

11. The system of claim 10, wherein the computing processor is further configured to execute the compiler on the computer program to generate the binary shader of each pass.

12. The system of claim 10, wherein the plurality of passes are arranged in series, and the graphics state of a subsequent pass specifies a change from the graphics state of a previous pass.

13. The system of claim 10, wherein the plurality of passes comprises a first pass and a second pass, the at least one parameter for the binary shader of the first pass comprises an output parameter, and the at least one parameter for the binary shader of the second pass comprises an input parameter, the input parameter for the binary shader of the second pass being the output parameter for the binary shader of the first pass.

14. The system of claim 10, wherein the graphics state of a first pass of the plurality of passes is an initial graphics state for a graphics object.

15. The system of claim 14, wherein the graphics state of a second pass of the plurality of passes specifies a change from the graphics state of the first pass.

16. The system of claim 10, wherein the descriptor of each pass specifies the binary shader of the pass.

17. The system of claim 10, wherein the descriptor of each pass specifies a plurality of binary shaders, and the at least one parameter for the binary shader of the pass identifies the binary shader of the pass from the plurality of binary shaders.

18. The system of claim 17, wherein the computer processor is configured to modify the at least one parameter for the binary shader of each pass at run time to configure the multi-pass shader.

19. The system of claim 10, wherein the application binary interface is a binary file.

20. A method of rendering a graphics object, the method comprising:

identifying a binary shader of a first pass of a multi-pass shader based on an application binary interface;
identifying a graphics state of the first pass based on the application binary interface;
executing the binary shader of the first pass based on the graphics state of the first pass to generate a result for the first pass;
identifying a binary shader of a second pass of the multi-pass shader based on the application binary interface;
identifying a graphics state of the second pass based on the application binary interface; and
executing the binary shader of the second pass based on the graphics state of the second pass and the result of the first pass to generate a result for the second pass.

21. The method of claim 20, wherein the result of the first pass comprises a first value of each pixel of a plurality of pixels of the graphics object, and the result of the second pass comprises a second value of each pixel of the plurality of pixels.

22. The method of claim 21, wherein the first value of each pixel in the plurality of pixels represents a color of the pixel.

23. The method of claim 21, wherein the second value of each pixel in the plurality of pixels represents a color of the pixel.

24. The method of claim 20, wherein the application binary interface comprises an output parameter for the binary shader of the first pass and an input parameter for the binary shader of the second pass, the output parameter for the binary shader of the first pass being the input parameter for the binary shader of the second pass.

25. The method of claim 24, wherein the output parameter for the binary shader of the first pass specifies the result of the first pass.

26. The method of claim 20, wherein the application binary interface comprises an output parameter for the binary shader of the second pass, the output parameter for the binary shader of the second pass specifying the result of the second pass.

27. The method of claim 20, wherein identifying the binary shader of the first pass of the multi-pass shader based on the application binary interface comprises selecting the binary shader of the first pass based on a descriptor of the first pass.

28. The method of claim 20, wherein identifying the binary shader of the first pass of the multi-pass shader based on the application binary interface comprises selecting the binary shader of the first pass based on a descriptor of the first pass and at least one parameter for the binary shader of the first pass.

29. A system for rendering a graphics object, the system comprising:

a computing processor configured to identify a binary shader of a first pass of a multi-pass shader, a graphics state of the first pass, a binary shader of a second pass of the multi-pass shader, and a graphics state of the second pass, based on an application binary interface; and
a graphics processor configured to execute the binary shader of the first pass based on the graphics state of the first pass to generate a result for the first pass, the graphics processor further configured to execute the binary shader of the second pass based on the graphics state of the second pass and the result of the first pass to generate a result for the second pass.

30. The system of claim 29, wherein the graphics object comprises a plurality of pixels, the result of the first pass comprises a first value of each pixel in the plurality of pixels, and the result of the second pass comprises a second value of each pixel in the plurality of pixels.

31. The system of claim 30, wherein the first value of each pixel in the plurality of pixels represents a color of the pixel.

32. The system of claim 30, wherein the second value of each pixel in the plurality of pixels represents a color of the pixel.

33. The system of claim 29, wherein the application binary interface comprises an output parameter for the binary shader of the first pass and an input parameter for the binary shader of the second pass, the output parameter for the binary shader of the first pass being the input parameter for the binary shader of the second pass.

34. The system of claim 29, wherein the computing processor is further configured to select the binary shader of the first pass based on a descriptor of the first pass.

35. The system of claim 29, wherein the computing processor is further configured to select the binary shader of the first pass based on a descriptor of the first pass and at least one parameter for the binary shader of the first pass.

36. A computer program product comprising computer program code for performing a method of rendering a graphics object, the method comprising:

identifying a binary shader of a first pass of a multi-pass shader based on an application binary interface;
identifying a graphics state of the first pass based on the application binary interface;
executing the binary shader of the first pass based on the graphics state of the first pass to generate a result for the first pass;
identifying a binary shader of a second pass of the multi-pass shader based on the application binary interface;
identifying a graphics state of the second pass based on the application binary interface; and
executing the binary shader of the second pass based on the graphics state of the second pass and the result of the first pass to generate a result for the second pass.

37. The computer program product of claim 36, wherein the graphics state of the second pass specifies a change from the graphics state of the first pass.

Patent History
Publication number: 20060071933
Type: Application
Filed: Oct 6, 2004
Publication Date: Apr 6, 2006
Applicant:
Inventors: Robin Green (Redwood City, CA), Axel Mamode (Mountain View, CA), Roy Hashimoto (Redwood City, CA)
Application Number: 10/959,695
Classifications
Current U.S. Class: 345/426.000
International Classification: G06T 15/50 (20060101); G06T 15/60 (20060101);