Search

US-12626462-B2 - Graphics processors

US12626462B2US 12626462 B2US12626462 B2US 12626462B2US-12626462-B2

Abstract

A sequence of primitives to be rendered is processed using a first, pre-pass operation to determine “visibility” information for the sequence of primitives, that is then used in a second, main pass operation in which fragments for primitives that were processed during the first, pre-pass operation are subjected to a visibility test that uses the visibility information determined during the first, pre-pass operation, to determine whether a fragment for a primitive should be processed further in the second, main pass operation. When a fragment is, in the second, main pass operation, subjected to and passes a particular form of visibility test so as to be determined as needing to be processed further, a processing order dependency that would be indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates is not enforced.

Inventors

  • Per Kristian Kjøll
  • Ahmed Mohamad Abdelmonim Salman

Assignees

  • ARM LIMITED

Dates

Publication Date
20260512
Application Date
20231115
Priority Date
20221117

Claims (20)

  1. 1 . A method of operating a graphics processor, the method comprising: for a sequence of primitives to be rendered for a render output: performing a main pass operation in which the processing of fragments for at least some of the primitives in the sequence of primitives is controlled based on visibility information for the sequence of primitives, wherein: controlling the processing of fragments for primitives when performing the main pass operation based on the visibility information for the sequence of primitives, comprises: as part of the main pass operation, subjecting a fragment for a primitive to a visibility test that uses the visibility information to determine whether the fragment for the primitive should be processed further in the main pass operation, the visibility test being such that when the visibility information indicates that the fragment should be processed further for the render output, the fragment is processed during the main pass operation by rendering the fragment to determine rendered output data for sampling positions associated with the fragment, whereas when the visibility information indicates that the fragment should not be processed further for the render output, some or all of the processing for the fragment during the main pass is omitted; the method further comprising: during the main pass operation maintaining for each of plural sub-regions of the render output, each sub-region relating to plural sampling positions of the render output, a record indicative of processing order dependencies between fragments that are to be processed for the sub-region of the render output in the main pass operation; and controlling the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on the record indicative of processing order dependencies between fragments to be processed for the sub-region of the render output; wherein: the controlling the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on the record indicative of processing order dependencies between fragments to be processed for the sub-region of the render output comprises: when a fragment to be processed for a primitive is, in the main pass operation, subjected to and passes a particular form of visibility test so as to be determined as needing to be processed further in the main pass operation, not enforcing a processing order dependency that would be indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates.
  2. 2 . The method of claim 1 , comprising: for a sequence of primitives to be rendered for a render output: performing a first, pre-pass operation in which primitives in the sequence of primitives to be rendered are processed by rasterising the primitives into respective sets of one or more fragments, each fragment associated with a respective set of one or more sampling positions within the render output, and wherein as part of the first, pre-pass operation fragments for the primitives in the sequence of primitives are processed to determine “visibility” information for the sequence of primitives, the visibility information being usable to determine whether or not fragments for a primitive in the sequence of primitives should subsequently be processed further for the render output; and thereafter performing the main pass operation in which the further processing of fragments for at least some of the primitives that were processed during the first, pre-pass operation is controlled based on the determined visibility information for the sequence of primitives, wherein: controlling the further processing of fragments for primitives that were processed during the first, pre-pass operation when performing the main pass operation based on the determined visibility information for the sequence of primitives, comprises: as part of the main pass operation, subjecting a fragment for a primitive that was processed during the first, pre-pass operation to a visibility test that uses the visibility information determined during the first, pre-pass operation, to determine whether the fragment for the primitive should be processed further in the main pass operation, the visibility test being such that when the visibility information indicates that the fragment should be processed further for the render output, the fragment is processed again during the main pass operation by rendering the fragment to determine rendered output data for sampling positions associated with the fragment, whereas when the visibility information indicates that the fragment should not be processed further for the render output the test, some or all of the processing for the fragment during the main pass is omitted.
  3. 3 . The method of claim 1 , wherein the determined visibility information comprises a set of primitive identifying information, the set of primitive identifying information storing for respective sampling positions within the render output respective primitive identifiers, where the primitive identifier stored for a respective sampling position indicates the primitive in the sequence of primitives that should subsequently be processed further for the sampling position.
  4. 4 . The method of claim 1 , wherein a record indicative of processing order dependencies between fragments that are to be processed for a sub-region of a render output comprises a list indicative of fragments that are to be processed for the sub-region of the render output for generating the render output, with each entry in the list representing a group of one or more fragments, and having associated with it: information indicating which part of the sub-region the one or more fragments that the entry represents apply to; and information indicating whether one or more processing operations are eligible to be performed for the one or more fragments that the entry represents.
  5. 5 . The method of claim 1 , wherein the particular form of visibility test that permits a processing order dependency to not be enforced comprises an EQUALS test, in which a value for a fragment is compared to a value in the visibility information for a sampling position or positions to which the fragment relates, with a fragment passing the visibility test only when the value for the fragment is equal to the value in the visibility information that the fragment is being tested against.
  6. 6 . The method of claim 1 , wherein there is a plurality of different visibility tests that can be performed in the main pass, and, as part of the main pass operation, a fragment for a primitive is subjected to one of the set of plural different visibility tests; and the controlling of the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on the records indicative of processing order dependencies between fragments to be processed for sub-regions of the render output during the main pass operation comprises: when a fragment to be processed for a primitive is, in the main pass operation, subjected to and passes a particular one of the set of plural different visibility tests so as to be determined as needing to be processed further in the main pass operation, not enforcing a processing order dependency that would be indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates; but when a fragment to be processed for a primitive is, in the main pass operation subjected to and passes a one of the set of plural different visibility tests that is not the particular one of the set of plural visibility tests so as to be determined as needing to be processed further in the main pass operation, enforcing any processing order dependencies indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates.
  7. 7 . The method of claim 1 , comprising not enforcing a colour buffer processing order dependency that could be indicated for a fragment in a record indicative of processing order dependencies for a sub-region of the render output to which a fragment relates when a fragment passes the particular visibility test.
  8. 8 . The method of claim 1 , wherein the not enforcing of a processing order dependency indicated for a fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates in the main pass operation when a fragment is subjected to and passes a particular visibility test so as to be determined as needing to be processed further in the main pass operation, comprises ignoring a processing order dependency indicated for the fragment in the record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates.
  9. 9 . The method of claim 1 , wherein the not enforcing of a processing order dependency indicated for a fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates in the main pass operation when a fragment is subjected to and passes a particular visibility test so as to be determined as needing to be processed further in the main pass operation, comprises setting the record indicative of processing order dependencies for the sub-region of the render output to which the fragment relates to indicate that the fragment does not have the processing order dependency that is not to be enforced.
  10. 10 . The method of claim 1 , wherein primitives in the sequence of primitives are associated with respective information indicative of whether or not a processing order dependency should be enforced for the primitive in the main pass, and wherein the main pass operation comprises checking the information to determine whether a processing order dependency should not be enforced for a primitive in the main pass.
  11. 11 . A graphics processor configured to generate a render output, the graphics processor comprising: a rasterising circuit that is operable to rasterise primitives into respective sets of one or more fragments; and a rendering circuit that is operable to process the resulting fragments to generate rendered output data; wherein the graphics processor is configured to: for a sequence of primitives to be rendered for a render output: perform a main pass operation in which a visibility testing circuit controls the further processing of fragments for at least some of the primitives in the sequence of primitives based on visibility information for the sequence of primitives, wherein: the visibility testing circuit is configured to control the further processing of fragments for primitives when performing the main pass operation based on the visibility information for the sequence of primitives, by: subjecting a fragment for a primitive to a visibility test that uses the visibility information, to determine whether the fragment for the primitive should be processed further in the main pass operation, the visibility test being such that when the visibility information indicates that the fragment should be processed further for the render output, the fragment is processed during the main pass operation by rendering the fragment to determine rendered output data for sampling positions associated with the fragment, whereas when the visibility information indicates that the fragment should not be processed further for the render output, some or all of the processing for the fragment during the main pass is omitted; the graphics processor further comprising: a fragment dependency record managing circuit configured to, during the main pass operation, maintain for each of plural sub-regions of the render output, each sub-region relating to plural sampling positions of the render output, a record indicative of processing order dependencies between fragments that are to be processed for the sub-region of the render output in the main pass operation; and a fragment processing control circuit configured to control the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on a record indicative of processing order dependencies between fragments to be processed for the sub-region of the render output; wherein: the fragment processing control circuit is configured to control the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on a record indicative of processing order dependencies between fragments to be processed for the sub-region of the render output by: when a fragment to be processed for a primitive is, in the main pass operation, subjected to and passes a particular form of visibility test so as to be determined as needing to be processed further in the main pass operation, not enforcing a processing order dependency that would be indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates.
  12. 12 . The graphics processor of claim 11 , wherein the graphics processor is configured to: for a sequence of primitives to be rendered for a render output: perform a first, pre-pass operation in which primitives in the sequence of primitives to be rendered are processed by: the rasterising circuit rasterising the primitives into respective sets of one or more fragments, each fragment associated with a respective set of one or more sampling positions within the render output; and a fragment visibility determining circuit processing, as part of the first, pre-pass operation, fragments for primitives in the sequence of primitives to determine “visibility” information for the sequence of primitives, the visibility information being usable to determine whether or not fragments for a primitive in the sequence of primitives should subsequently be processed further for the render output; and thereafter perform the main pass operation in which a visibility testing circuit controls the further processing of fragments for at least some of the primitives that were processed during the first, pre-pass operation based on the determined visibility information for the sequence of primitives, wherein: the visibility testing circuit is configured to control the further processing of fragments for primitives that were processed during the first, pre-pass operation when performing the main pass operation based on the determined visibility information for the sequence of primitives, by: subjecting a fragment for a primitive that was processed during the first, pre-pass operation to a visibility test that uses the visibility information determined during the first, pre-pass operation, to determine whether the fragment for the primitive should be processed further in the main pass operation, the visibility test being such that when the visibility information indicates that the fragment should be processed further for the render output, the fragment is processed again during the main pass operation by rendering the fragment to determine rendered output data for sampling positions associated with the fragment, whereas when the visibility information indicates that the fragment should not be processed further for the render output the test is not passed and some or all of the processing for the fragment during the main pass is omitted.
  13. 13 . The graphics processor of claim 11 , wherein the determined visibility information comprises a set of primitive identifying information, the set of primitive identifying information storing for respective sampling positions within the render output respective primitive identifiers, where the primitive identifier stored for a respective sampling position indicates the primitive in the sequence of primitives that should subsequently be processed further for the sampling position.
  14. 14 . The graphics processor of claim 11 , wherein a record indicative of processing order dependencies between fragments that are to be processed for a sub-region of a render output comprises a list indicative of fragments that are to be processed for the sub-region of the render output for generating the render output, with each entry in the list representing a group of one or more fragments, and having associated with it: information indicating which part of the sub-region the one or more fragments that the entry represents apply to; and information indicating whether one or more processing operations are eligible to be performed for the one or more fragments that the entry represents.
  15. 15 . The graphics processor of claim 11 , wherein the particular form of visibility test that permits a processing order dependency to not be enforced comprises an EQUALS test, in which a value for a fragment is compared to a value in the visibility information for a sampling position or positions to which the fragment relates, with a fragment passing the visibility test only when the value for the fragment is equal to the value in the visibility information that the fragment is being tested against.
  16. 16 . The graphics processor of claim 11 , wherein there is a plurality of different visibility tests that can be performed in the main pass, and, as part of the main pass operation, a fragment is subjected to one of the set of plural different visibility tests; and the fragment processing control circuit is configured to control the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on the records indicative of processing order dependencies between fragments to be processed for sub-regions of the render output during the main pass operation by: when a fragment to be processed for a primitive is, in the main pass operation, subjected to and passes a particular one of the set of plural different visibility tests so as to be determined as needing to be processed further in the main pass operation, not enforcing a processing order dependency that would be indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates; but when a fragment to be processed for a primitive is, in the main pass operation subjected to and passes a one of the set of plural different visibility tests that is not the particular one of the set of plural visibility tests so as to be determined as needing to be processed further in the main pass operation, enforcing any processing order dependencies indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates.
  17. 17 . The graphics processor of claim 11 , wherein the fragment processing control circuit is configured to not enforce a colour buffer processing order dependency that could be indicated for a fragment in a record indicative of processing order dependencies for a sub-region of the render output to which a fragment relates when a fragment passes the particular visibility test.
  18. 18 . The graphics processor of claim 11 , wherein the not enforcing of a processing order dependency indicated for a fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates in the main pass operation when a fragment is subjected to and passes a particular visibility test so as to be determined as needing to be processed further in the main pass operation, comprises (i) ignoring a processing order dependency indicated for the fragment in the record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates, and/or (ii) setting a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates to indicate that the fragment does not have the processing order dependency that is not to be enforced.
  19. 19 . The graphics processor of claim 11 , wherein primitives in the sequence of primitives are associated with respective information indicative of whether or not a processing order dependency should be enforced for the primitive in the main pass, and wherein the graphics processor is configured to, in the main pass operation, check the information to determine whether a processing order dependency should be enforced for a primitive in the main pass.
  20. 20 . A non-transitory computer readable medium storing computer software code for performing, when the computer software code is run on one or more data processors, a method of operating a graphics processor, the method comprising: for a sequence of primitives to be rendered for a render output: performing a main pass operation in which the processing of fragments for at least some of the primitives in the sequence of primitives is controlled based on visibility information for the sequence of primitives, wherein: controlling the processing of fragments for primitives when performing the main pass operation based on the visibility information for the sequence of primitives, comprises: as part of the main pass operation, subjecting a fragment for a primitive to a visibility test that uses the visibility information to determine whether the fragment for the primitive should be processed further in the main pass operation, the visibility test being such that when the visibility information indicates that the fragment should be processed further for the render output, the fragment is processed during the main pass operation by rendering the fragment to determine rendered output data for sampling positions associated with the fragment, whereas when the visibility information indicates that the fragment should not be processed further for the render output, some or all of the processing for the fragment during the main pass is omitted; the method further comprising: during the main pass operation maintaining for each of plural sub-regions of the render output, each sub-region relating to plural sampling positions of the render output, a record indicative of processing order dependencies between fragments that are to be processed for the sub-region of the render output in the main pass operation; and controlling the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on the record indicative of processing order dependencies between fragments to be processed for the sub-region of the render output; wherein: the controlling the processing of fragments to be processed for a sub-region of the render output in the main pass operation based on the record indicative of processing order dependencies between fragments to be processed for the sub-region of the render output comprises: when a fragment to be processed for a primitive is, in the main pass operation, subjected to and passes a particular form of visibility test so as to be determined as needing to be processed further in the main pass operation, not enforcing a processing order dependency that would be indicated for the fragment in a record indicative of processing order dependencies for a sub-region of the render output to which the fragment relates.

Description

BACKGROUND The technology described herein relates to the processing of computer graphics, and in particular to hidden surface removal in graphics processing. Many data processing systems include a graphics processor (graphics processing unit (GPU)) as a processing resource that is operable to perform processing tasks for, e.g., applications that are executing on a, e.g., main (e.g. host) processor (CPU) of the data processing system. A graphics processor may thus be caused to perform processing tasks for applications by providing to the graphics processor a stream of commands (instructions) to be executed by the graphics processor. For example, a driver for the graphics processor may prepare a command stream containing commands (instructions) to be performed by the graphics processor, and provide the command stream to the graphics processor, with the graphics processor then performing the commands (the operations indicated by the commands) in the command stream. The graphics processor may further comprise a suitable command stream frontend that acts to parse the driver-generated commands and schedule processing tasks for the various functional units of the graphics processor accordingly. A graphics processor may thus be provided as a hardware accelerator that is operable to perform graphics processing on demand from a main (e.g. host) processor (CPU). The graphics processor is generally configured for performing graphics processing in a more optimised manner (e.g. compared to using the main (e.g. host) processor (CPU) to perform the processing using general-purpose computations). Graphics processing is normally carried out by first dividing the graphics processing (render) output to be rendered, such as a frame to be displayed, into a number of similar basic components of geometry to allow the graphics processing operations to be more easily carried out. These basic components of geometry may often be referred to graphics “primitives”, and such “primitives” are usually in the form of simple polygons, such as triangles, points, lines, etc. (or groups thereof). Each primitive (e.g. polygon) is at this stage defined by and represented as a set of vertices. Each vertex for a primitive has associated with it a set of data (such as position, colour, texture and other attributes data) representing the vertex. This “vertex data” is then used, e.g., when rasterising and rendering the primitive(s) to which the vertex relates in order to generate the desired render output of the graphics processing. For a given output, e.g. frame to be displayed, to be generated by the graphics processing, there will typically be a set of vertices defined for the output in question. The primitives to be processed for the output will then be indicated as comprising given vertices in the set of vertices for the graphics processing output being generated. Typically, the overall output, e.g. frame to be generated, will be divided into smaller units of processing, referred to as “draw calls”. Each draw call will have a respective set of vertices defined for it and respective primitives that use those vertices. For a given frame, there may, e.g., be of the order of a few thousand draw calls, and hundreds of thousands (or potentially millions) of primitives. Once primitives and their vertices have been generated and defined, they can be processed by the graphics processor, in order to generate the desired graphics processing output (render target), such as a frame for display. This basically involves determining which sampling positions of an array of sampling positions associated with the render output area to be processed are covered by a primitive, and then determining the appearance each sampling position should have (e.g. in terms of its colour, etc.) to represent the primitive at that sampling position. These processes are commonly referred to as rasterising and rendering, respectively. (The term “rasterisation” is sometimes used to mean both primitive conversion to sample positions and rendering. However, herein “rasterisation” will be used to refer to converting primitive data to sampling position addresses only.) These processes are typically carried out by testing sets of one, or of more than one, sampling position, and then generating for each set of sampling positions found to include a sampling position that is inside (covered by) the primitive in question (being tested), a discrete graphical entity usually referred to as a “fragment” on which the graphics processing operations (such as rendering) are carried out. Covered sampling positions are thus, in effect, processed as fragments that will be used to render the primitive at the sampling positions in question. The “fragments” are the graphical entities that pass through the rendering process (the rendering pipeline). Each fragment that is generated and processed may, e.g., represent a single sampling position or a set of plural sampling positions, depending upon how the grap