CPC G06T 1/20 (2013.01) [G06F 9/3877 (2013.01); G06F 9/461 (2013.01); G06F 9/5061 (2013.01); G06T 15/005 (2013.01); G06T 15/10 (2013.01); G06T 17/10 (2013.01)] | 26 Claims |
1. A method for graphics processing, comprising:
rendering graphics for an application using a plurality of graphics processing units (GPUs);
dividing responsibility for the rendering of geometry of the graphics for a plurality of image frames between the plurality of GPUs based on a plurality of screen regions, each GPU having a corresponding division of the responsibility which is known to the plurality of GPUs;
assigning in a frame period a plurality of pieces of geometry of an image frame to the plurality of GPUs for geometry testing;
setting in the frame period a first value in random access memory defining a first GPU state for the plurality of GPUs to perform the geometry testing, wherein the first value is set externally from execution of a command buffer;
calling in the frame period a subroutine a first time to perform the geometry testing based on the first value defining the first GPU state, wherein the subroutine includes a plurality of commands in the command buffer;
in a first pass of the command buffer in the frame period by each of the plurality of GPUs to process the subroutine called for the first time, executing a first group of commands of the plurality of commands to configure each of one or more shaders executed by the plurality of GPUs to perform the geometry testing on the plurality of pieces of geometry of the image frame, wherein execution of a command in the first group of commands is skipped based on the first value as not being required for configuring the each of the one or more shaders to perform the geometry testing;
in the first pass of the command buffer in the frame period, executing remaining commands in the plurality of commands to perform the geometry testing by the one or more shaders executed by the plurality of GPUs on the plurality of pieces of geometry of the image frame to generate information regarding each piece of geometry and its relation to each of the plurality of screen regions for the image frame, wherein the executing of the remaining commands in the plurality of commands to perform the geometry testing includes interpreting a subset of the remaining commands using a first interpretation based on the first value defining the first GPU state;
setting in the frame period a second value to the random access memory defining a second GPU state for the plurality of GPUs to perform rendering of the image frame using the plurality of commands in the command buffer, wherein the second configuration value is set externally from execution of the command buffer;
calling in the frame period the subroutine for a second time to perform the rendering of the image frame based on the second value defining the second GPU state;
in a second pass of the command buffer in the frame period by each of the plurality of GPUs to process the subroutine called for the second time, executing the first group of commands to configure the each of the one or more shaders executed by the plurality of GPUs to perform the rendering of the image frame, wherein execution of the command in the first group of commands is performed based on the second value as being required for configuring the each of the one or more shaders to perform the rendering of the image frame; and
in the second pass of the command buffer in the frame period, using the information generated for each of the plurality of pieces of geometry of the image frame when executing the remaining commands in the plurality of commands to perform the rendering of the plurality of pieces of geometry of the image frame by the plurality of GPUs to render the image frame,
wherein a corresponding shader as executed by a corresponding GPU is configured to perform the geometry testing on a piece of geometry of a corresponding object of the image frame in the first pass of the command buffer in the frame period, and the corresponding shader as executed by the corresponding GPU is configured to perform rendering of the piece of geometry of the corresponding object of the image frame in the second pass of the command buffer in the frame period, and
wherein the executing the remaining commands in the plurality of commands to perform the rendering includes interpreting the subset of the remaining commands using a second interpretation based on the second value defining the second GPU state.
|