Search Images Maps Play YouTube News Gmail Drive More »
Sign in
Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.

Patents

  1. Advanced Patent Search
Publication numberUS20060071933 A1
Publication typeApplication
Application numberUS 10/959,695
Publication dateApr 6, 2006
Filing dateOct 6, 2004
Priority dateOct 6, 2004
Also published asUS8289325, US20090040222, WO2006041993A1
Publication number10959695, 959695, US 2006/0071933 A1, US 2006/071933 A1, US 20060071933 A1, US 20060071933A1, US 2006071933 A1, US 2006071933A1, US-A1-20060071933, US-A1-2006071933, US2006/0071933A1, US2006/071933A1, US20060071933 A1, US20060071933A1, US2006071933 A1, US2006071933A1
InventorsRobin Green, Axel Mamode, Roy Hashimoto
Original AssigneeSony Computer Entertainment Inc.
Export CitationBiBTeX, EndNote, RefMan
External Links: USPTO, USPTO Assignment, Espacenet
Application binary interface for multi-pass shaders
US 20060071933 A1
Abstract
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.
Images(8)
Previous page
Next page
Claims(37)
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.
Description
    BACKGROUND
  • [0001]
    1. Field of the Invention
  • [0002]
    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.
  • [0003]
    2. Background Art
  • [0004]
    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.
  • [0005]
    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.
  • [0006]
    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.
  • [0007]
    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.
  • [0008]
    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.
  • [0009]
    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.
  • [0010]
    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
  • [0011]
    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.
  • [0012]
    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.
  • [0013]
    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.
  • [0014]
    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.
  • [0015]
    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.
  • [0016]
    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.
  • [0017]
    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
  • [0018]
    FIG. 1 is a block diagram of an exemplary computing environment, in accordance with one embodiment of the present invention;
  • [0019]
    FIG. 2 is a block diagram of the exemplary computing system of FIG. 1;
  • [0020]
    FIG. 3 is a block diagram of the exemplary computer graphics system of FIG. 1;
  • [0021]
    FIG. 4 is a block diagram of the exemplary graphics pipeline of FIG. 3;
  • [0022]
    FIG. 5 is a block diagram of the exemplary application program of FIG. 1;
  • [0023]
    FIG. 6 is a block diagram of the exemplary binary program of FIG. 1;
  • [0024]
    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
  • [0025]
    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
  • [0026]
    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.
  • [0027]
    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.
  • [0028]
    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.
  • [0029]
    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.
  • [0030]
    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.
  • [0031]
    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.
  • [0032]
    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.
  • [0033]
    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.
  • [0034]
    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.
  • [0035]
    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.
  • [0036]
    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.
  • [0037]
    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.
  • [0038]
    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.
  • [0039]
    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.
  • [0040]
    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.
  • [0041]
    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.
  • [0042]
    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
  • [0043]
    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.
  • [0044]
    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.
  • [0045]
    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).
  • [0046]
    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.
  • [0047]
    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.
  • [0048]
    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.
  • [0049]
    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.
  • [0050]
    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.
  • [0051]
    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.
  • [0052]
    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.
  • [0053]
    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.
  • [0054]
    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.
  • [0055]
    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.
  • [0056]
    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.
  • [0057]
    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.
  • [0058]
    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.
Patent Citations
Cited PatentFiling datePublication dateApplicantTitle
US4683466 *Dec 14, 1984Jul 28, 1987Honeywell Information Systems Inc.Multiple color generation on a display
US5253339 *Jul 26, 1990Oct 12, 1993Sun Microsystems, Inc.Method and apparatus for adaptive Phong shading
US5559950 *Feb 2, 1994Sep 24, 1996Video Lottery Technologies, Inc.Graphics processor enhancement unit
US5805782 *Jan 23, 1996Sep 8, 1998Silicon Graphics, Inc.Method and apparatus for projective texture mapping rendered from arbitrarily positioned and oriented light source
US5808617 *Jun 27, 1996Sep 15, 1998Microsoft CorporationMethod and system for depth complexity reduction in a graphics rendering system
US5852443 *Jun 27, 1996Dec 22, 1998Microsoft CorporationMethod and system for memory decomposition in a graphics rendering system
US5864342 *Jun 27, 1996Jan 26, 1999Microsoft CorporationMethod and system for rendering graphical objects to image chunks
US5870097 *Jun 27, 1996Feb 9, 1999Microsoft CorporationMethod and system for improving shadowing in a graphics rendering system
US5870098 *Feb 26, 1997Feb 9, 1999Evans & Sutherland Computer CorporationMethod for rendering shadows on a graphical display
US5880736 *Jun 20, 1997Mar 9, 1999Silicon Graphics, Inc.Method system and computer program product for shading
US5977977 *Jun 27, 1996Nov 2, 1999Microsoft CorporationMethod and system for multi-pass rendering
US6016150 *Jul 30, 1997Jan 18, 2000Microsoft CorporationSprite compositor and method for performing lighting and shading operations using a compositor to combine factored image layers
US6252608 *Oct 22, 1998Jun 26, 2001Microsoft CorporationMethod and system for improving shadowing in a graphics rendering system
US6421057 *Jul 15, 1999Jul 16, 2002Terarecon, Inc.Configurable volume rendering pipeline
US6578197 *Apr 8, 1998Jun 10, 2003Silicon Graphics, Inc.System and method for high-speed execution of graphics application programs including shading language instructions
US6646639 *Jun 19, 2001Nov 11, 2003Nvidia CorporationModified method and apparatus for improved occlusion culling in graphics systems
US6646640 *Feb 6, 2001Nov 11, 2003Sony Computer Entertainment Inc.System and method for creating real-time shadows of complex transparent objects
US6717599 *Jun 29, 2000Apr 6, 2004Microsoft CorporationMethod, system, and computer program product for implementing derivative operators with graphics hardware
US7006101 *Jun 25, 2002Feb 28, 2006Nvidia CorporationGraphics API with branching capabilities
US20020018063 *Dec 5, 2000Feb 14, 2002Donovan Walter E.System, method and article of manufacture for shadow mapping
US20020140703 *Aug 24, 2001Oct 3, 2002Baker Nicholas R.Applying multiple texture maps to objects in three-dimensional imaging processes
US20030009748 *Jun 8, 2001Jan 9, 2003Glanville Robert StevenSoftware emulator for optimizing application-programmable vertex processing
US20030117391 *Dec 21, 2001Jun 26, 2003Silicon Graphics, Inc.System, method, and computer program product for real-time shading of computer generated images
US20030179220 *Mar 20, 2002Sep 25, 2003Nvidia CorporationSystem, method and computer program product for generating a shader program
US20040051716 *Dec 19, 2002Mar 18, 2004Benoit SevignyImage processing
US20040130550 *Oct 23, 2003Jul 8, 2004Microsoft CorporationMultiple-level graphics processing with animation interval generation
US20040130552 *Jun 9, 2003Jul 8, 2004Duluk Jerome F.Deferred shading graphics pipeline processor having advanced features
US20050078116 *Mar 31, 2004Apr 14, 2005Microsoft CorporationSystems and methods for robust sampling for real-time relighting of objects in natural lighting environments
US20050243094 *Sep 3, 2004Nov 3, 2005Microsoft CorporationSystems and methods for providing an enhanced graphics pipeline
Referenced by
Citing PatentFiling datePublication dateApplicantTitle
US7623132 *Dec 20, 2004Nov 24, 2009Nvidia CorporationProgrammable shader having register forwarding for reduced register-file bandwidth consumption
US7861234 *Feb 23, 2005Dec 28, 2010Oracle America, Inc.System and method for binary translation to improve parameter passing
US8133115Oct 22, 2003Mar 13, 2012Sony Computer Entertainment America LlcSystem and method for recording and displaying a graphical path in a video game
US8204272Jun 17, 2011Jun 19, 2012Sony Computer Entertainment Inc.Lighting control of a user environment via a display device
US8243089Feb 1, 2011Aug 14, 2012Sony Computer Entertainment Inc.Implementing lighting control of a user environment
US8276129 *Aug 13, 2007Sep 25, 2012Nvidia CorporationMethods and systems for in-place shader debugging and performance tuning
US8284310Apr 5, 2011Oct 9, 2012Sony Computer Entertainment America LlcDelay matching in audio/video systems
US8289325Oct 7, 2008Oct 16, 2012Sony Computer Entertainment America LlcMulti-pass shading
US8296738 *Aug 13, 2007Oct 23, 2012Nvidia CorporationMethods and systems for in-place shader debugging and performance tuning
US8345045 *Mar 4, 2008Jan 1, 2013Microsoft CorporationShader-based extensions for a declarative presentation framework
US9165396 *Feb 26, 2013Oct 20, 2015Nvidia CorporationGraphics processing unit with a texture return buffer and a texture queue
US9171525 *Feb 26, 2013Oct 27, 2015Nvidia CorporationGraphics processing unit with a texture return buffer and a texture queue
US9342817Aug 29, 2011May 17, 2016Sony Interactive Entertainment LLCAuto-creating groups for sharing photos
US20090040222 *Oct 7, 2008Feb 12, 2009Robin James GreenMulti-pass shading
US20090225079 *Mar 4, 2008Sep 10, 2009Microsoft CorporationShader-based extensions for a declarative presentation framework
US20120290560 *May 13, 2011Nov 15, 2012Kushal DasMechanism for efficiently querying application binary interface/application programming interface-related information
US20130127858 *May 29, 2009May 23, 2013Luc LeroyInterception of Graphics API Calls for Optimization of Rendering
US20140240329 *Feb 26, 2013Aug 28, 2014Nvidia CorporationGraphics processing unit with a texture return buffer and a texture queue
US20140240337 *Feb 26, 2013Aug 28, 2014Nvidia CorporationGraphics processing unit with a texture return buffer and a texture queue
US20150379672 *Apr 6, 2015Dec 31, 2015Samsung Electronics Co., LtdDynamically optimized deferred rendering pipeline
Classifications
U.S. Classification345/426
International ClassificationG06T15/50, G06T15/60
Cooperative ClassificationG06T15/80, G06F8/41, G06T15/50
European ClassificationG06T15/50, G06T15/80
Legal Events
DateCodeEventDescription
Oct 6, 2004ASAssignment
Owner name: SONY COMPUTER ENTERTAINMENT INC., JAPAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:GREEN, ROBIN JAMES;MAMODE, AXEL;HASHIMOTO, ROY TADASHI;REEL/FRAME:015874/0913;SIGNING DATES FROM 20041005 TO 20041006
Dec 26, 2011ASAssignment
Owner name: SONY NETWORK ENTERTAINMENT PLATFORM INC., JAPAN
Free format text: CHANGE OF NAME;ASSIGNOR:SONY COMPUTER ENTERTAINMENT INC.;REEL/FRAME:027446/0001
Effective date: 20100401
Dec 27, 2011ASAssignment
Owner name: SONY COMPUTER ENTERTAINMENT INC., JAPAN
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:SONY NETWORK ENTERTAINMENT PLATFORM INC.;REEL/FRAME:027557/0001
Effective date: 20100401
Jul 1, 2016ASAssignment
Owner name: SONY INTERACTIVE ENTERTAINMENT INC., JAPAN
Free format text: CHANGE OF NAME;ASSIGNOR:SONY COMPUTER ENTERTAINMENT INC.;REEL/FRAME:039239/0343
Effective date: 20160401