Shader core instructions that call depth culling

By calling the culling function of the depth culling unit in the shader core of the graphics processor, the problem of multiple primitive occlusions in the graphics processor is solved and rendering efficiency and performance are improved.

CN116018620BActive Publication Date: 2024-09-03ADVANCED MICRO DEVICES INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202180053555.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-08-31
Filing Date
2021-08-27
Publication Date
2024-09-03
Estimated Expiration
2041-08-27

AI Technical Summary

Technical Problem

When the existing technology processes multiple graphics primitives in a graphics processor, it is difficult to efficiently determine which graphics primitive is visible, resulting in an increase in unnecessary processing tasks and affecting performance and efficiency.

Method used

By executing the instructions of the depth culling unit in the shader core, calling the culling function to access the real-time depth buffer determines whether the primitive is occluded, thereby avoiding unnecessary draw calls and processing tasks.

Benefits of technology

Improves the performance of the graphics processing pipeline, reduces unnecessary processing tasks, and improves rendering efficiency and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116018620B_ABST
    Figure CN116018620B_ABST
Patent Text Reader

Abstract

Disclosed herein are systems, devices, and methods for executing shader core instructions to invoke depth culling. The shader core executes instructions to invoke a culling function on a depth culling unit for one or more entities before completing a corresponding draw call. The shader core provides a mode and coordinates to the depth culling unit as a result of executing the instruction. The depth culling unit implements a culling function to access a real-time depth buffer to determine whether one or more primitives corresponding to the entity are occluded. The culling unit returns an indication of the result of processing the one or more primitives to the shader core. For example, if the result indicates that a primitive is occluded, the shader core cancels the draw call for the primitive.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0001] Related technical description

[0002] Graphics processors are commonly used within computer graphics processing systems to create computer-generated images from geometric models. The geometric model defines the various objects, details, lighting sources, and other elements of a virtual scene. The computing system determines how to render a given scene based on the geometric model and other inputs from software applications. These inputs include graphical objects such as points, lines, polygons, meshlets, three-dimensional solid objects, and other objects. These objects may be more generally referred to as "primitives."

[0003] A graphics processing unit (GPU) or other type of processor processes these inputs and the geometric model to generate a two-dimensional or three-dimensional array of pixel color values ​​representing a desired image or video frame. Each pixel of a frame has multiple attributes associated with it, including color and texture. Typically, a shader is used to perform arithmetic and logical operations on the attributes of each pixel to achieve a final value representing the pixel. A shader can be a program, fixed-function hardware, a control logic unit, or any combination of these and / or other processing elements. When the pixel is driven to a display device, the final value is placed in a frame buffer and used.

[0004] When multiple primitives are rendered and projected onto the same pixel on the screen, the rendering engine needs to determine which primitive is visible and which primitives are obscured. One technique for solving the occlusion problem involves performing a depth test with a depth buffer. For each pixel on the screen, the distance to the nearest object from the perspective of the viewpoint is stored in the depth buffer. When a primitive is projected onto a given pixel in screen space, a depth test is performed to determine whether the rendered primitive is closer to the screen (i.e., the viewpoint) than the nearest primitive previously rendered. If the primitive is closer to the viewpoint than the previously rendered primitive, the primitive passes the test. Otherwise, if the primitive is farther away from the viewpoint than any previously rendered primitive, the primitive fails the test. The viewpoint is defined by a virtual camera representing the user's viewpoint or perspective.

[0005] Although the following disclosure relates to the above context, it should be understood that the methods and mechanisms described herein may also be used in other contexts to increase throughput, improve performance, reduce power consumption, and achieve other advantages. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Advantages of the methods and mechanisms described herein may be better understood by referring to the following description in conjunction with the accompanying drawings, in which:

[0007] Figure 1 is a block diagram of a specific implementation of a computing system.

[0008] Figure 2 is a block diagram of another specific implementation of a computing system.

[0009] Figure 3 is a block diagram of another specific implementation of a computing system.

[0010] Figure 4 is a generalized flow chart illustrating one specific implementation of a method for executing shader core instructions to invoke depth culling.

[0011] Figure 5 is a generalized flow chart illustrating one specific implementation of a method for executing shader core instructions to invoke depth culling.

[0012] Figure 6 is a generalized flow chart illustrating one specific implementation of a method for converting a draw call to a culling function query.

[0013] Figure 7 is a generalized flow chart illustrating one specific implementation of a method for synthesizing entities when generating queries for culling cells. DETAILED DESCRIPTION

[0014] In the following description, many specific details are set forth to provide a thorough understanding of the methods and mechanisms presented herein. However, it will be appreciated by those of ordinary skill in the art that various specific implementations may be practiced without these specific details. In some cases, well-known structures, components, signals, computer program instructions, and techniques are not shown in detail to avoid blurring the methods described herein. It should be understood that, for simplicity and clarity of description, the elements shown in the accompanying drawings are not necessarily drawn to scale. For example, the size of some of these elements may be enlarged relative to other elements.

[0015] Various systems, devices, and methods for executing shader core instructions to invoke depth culling are disclosed herein. In one specific implementation, the shader core executes instructions to invoke a culling function on a depth culling unit for one or more entities (e.g., primitives, screen space rectangles) before completing a corresponding draw call. The shader core provides a mode and coordinates to the depth culling unit as a result of executing the instruction. In one specific implementation, the depth culling unit implements a culling function to access a real-time depth buffer to determine whether one or more primitives are occluded. The culling unit returns an indication of the result of processing the one or more entities to the shader core. In response to receiving an indication of the result of the culling function, the shader core decides whether to modify, cancel, or continue with the draw call. For example, in one specific implementation, if the result from the culling unit indicates that the primitive is occluded, the shader core cancels the draw call for the primitive. The shader core may take other types of actions based on the result generated by the culling unit. Therefore, the graphics processing pipeline avoids any unnecessary processing tasks associated with the draw call, thereby improving the performance of the graphics processing pipeline.

[0016] Reference now Figure 1 , a block diagram of one implementation of a computing system 100 is shown. In one implementation, computing system 100 includes at least processors 105A-105N, input / output (I / O) interface 120, bus 125, memory controller 130, network interface 135, memory device 140, display controller 150, and display 155. In other implementations, computing system 100 includes other components and / or computing system 100 is arranged in a different manner. Processors 105A-105N represent any number of processors included in system 100.

[0017] In one specific implementation, processor 105A is a general purpose processor, such as a central processing unit (CPU). In this specific implementation, processor 105A executes driver 110 (e.g., a graphics driver) for communicating with one or more other processors in system 100 and / or controlling the operation of the one or more other processors in the system. It should be noted that, depending on the specific implementation, driver 110 can be implemented using any suitable combination of hardware, software and / or firmware. In one specific implementation, processor 105N is a data parallel processor with a highly parallel architecture. Data parallel processors include graphics processing units (GPUs), digital signal processors (DSPs), field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), etc. In some specific implementations, processors 105A-105N include multiple data parallel processors. In one specific implementation, processor 105N is a GPU that provides pixels to display controller 150 for driving to display 155.

[0018] The memory controller 130 represents any number and type of memory controllers that can be accessed by the processors 105A-105N. Although the memory controller 130 is shown as being separate from the processors 105A-105N, it should be understood that this merely represents one possible implementation. In other implementations, the memory controller 130 may be embedded within one or more of the processors 105A-105N, and / or the memory controller 130 may be located on the same semiconductor chip as one or more of the processors 105A-105N. The memory controller 130 is coupled to any number and type of memory devices 140. The memory devices 140 represent any number and type of memory devices. For example, the types of memory in the memory devices 140 include dynamic random access memory (DRAM), static random access memory (SRAM), NAND flash memory, NOR flash memory, ferroelectric random access memory (FeRAM), etc.

[0019] The I / O interface 120 represents any number and type of I / O interfaces (e.g., a peripheral component interconnect (PCI) bus, a PCI-Extended (PCI-X), a PCIE (PCI Express) bus, a Gigabit Ethernet (GBE) bus, a Universal Serial Bus (USB)). Various types of peripheral devices (not shown) are coupled to the I / O interface 120. Such peripheral devices include (but are not limited to) a display, a keyboard, a mouse, a printer, a scanner, a joystick or other type of game controller, a media recording device, an external storage device, a network interface card, etc. The network interface 135 is capable of receiving and sending network messages over a network.

[0020] In various implementations, computing system 100 is any of a computer, a laptop, a mobile device, a game console, a server, a streaming device, a wearable device, or various other types of computing systems or devices. It should be noted that the number of components of computing system 100 varies from implementation to implementation. For example, in other implementations, there are more than one component. Figure 1 More or less of each component may be shown. It should also be noted that in other implementations, the computing system 100 includes Figure 1 In addition, in other specific implementations, the computing system 100 is different from Figure 1 Constructed in the manner shown.

[0021] Now turn to Figure 2, which shows a block diagram of another specific implementation of a computing system 200. In one specific implementation, the system 200 includes a GPU 205, a system memory 225, and a local memory 230. The system 200 may also include other components that are not shown to avoid obscuring the figure. The GPU 205 includes at least a command processor 235, a control logic component 240, a scheduling unit 250, a computing unit 255A-N, a memory controller 220, a global data sharing 270, a level 1 (L1) cache 265, and a level 2 (L2) cache 260. In other specific implementations, the GPU 205 includes other components, omits one or more of the components shown, has multiple instances of components (even if Figure 2 In one embodiment, the circuitry of GPU 205 includes ( Figure 1 ) processor 105N.

[0022] In various implementations, the computing system 200 executes any of various types of software applications. As part of executing a given software application, a host CPU (not shown) of the computing system 200 initiates work to be performed on the GPU 205. In one implementation, the command processor 235 receives a draw call from the host CPU, and the command processor 235 uses the scheduling unit 250 to issue a draw call to the computing units 255A-N. In response to initiating a draw call for a given mesh model subset, the computing units 255A-N call a depth culling function for the given mesh model subset to determine whether to cancel, modify, or execute the draw call for the given mesh model subset. The given mesh model subset may include any number of vertices. More details on these and other techniques will be provided throughout the remainder of this disclosure.

[0023] Reference now Figure 3, which shows a block diagram of another specific implementation of the computing system 300. In one specific implementation, the computing system 300 includes at least a control unit 305, a cache / memory subsystem 310, a shader core 320, a rasterizer 330, a culling unit 340, and a depth buffer 345. The control unit 305 coordinates the processing performed by the various units of the system 300 as part of rendering one or more frames or one or more portions of a frame. The control unit 305 can be implemented using any suitable combination of software and / or hardware. It is noted that the control unit 305 can also be referred to as a control logic unit 305. In addition, a portion of the control unit 305 can be located within the shader core 320 and the culling unit 340, and a portion of the control unit 305 can be located outside the shader core 320 and the culling unit 340. Any suitable arrangement of the logic components of the control unit 305 throughout the system 300 can be implemented. The computing system 300 may include any number of other components (e.g., memory devices, frame buffers, displays) that are not shown to avoid obscuring the drawings.

[0024] The shader core 320 includes any number of shader units 325A-N from 1 to N, where N is a positive integer greater than 1. It should be noted that the shader units 325A-N may also be referred to as shader levels 325A-N. The shader units 325A-N may include any number and type of shaders, such as vertex shaders, hull shaders, tessellation, light shaders, pixel shaders, geometry shaders, mesh shaders, magnification shaders, domain shaders, fragment shaders, compute shaders, and the like. Different shader cores 320 in different specific implementations may have different combinations and arrangements of the individual shader units 325A-N. The shader core 320 may also be referred to as a shader pipeline 320 in this article. In addition, the culling unit 340 may also be referred to as a depth culling unit 340 in this article.

[0025] In one implementation, the control unit 305 issues a draw call to the shader core 320 for one or more primitives. In response to receiving the draw call, the shader core 320 retrieves the corresponding primitive from the cache / memory subsystem 310. In one implementation, the shader core 320 executes an instruction to access the culling unit 340 during the draw call. In one implementation, the instruction accesses a given interface 322A-N from a corresponding shader 325A-N of the shader core 320. Although multiple interfaces 322A-N are shown, these interfaces are intended to represent that the culling unit 340 can be accessed from any shader 325A-N. In other words, in some implementations, the interfaces 322A-N can actually consist of a single interface. In addition, the culling unit 340 includes an interface 342 for receiving instructions and corresponding parameters from the shader core 320.

[0026] The instructions executed by the shader core 320 allow the shader core 320 to query the culling unit 340 to perform a culling test during the shading process. In one specific implementation, the query includes one or more parameters associated with one or more primitives. In another specific implementation, the query includes parameters defining a screen space rectangle with an extent. In one specific implementation, in response to receiving the query, the culling unit 340 performs a culling function by accessing the depth buffer 345. It should be noted that the depth buffer 345 accessed in response to the instructions executed by the shader core 320 is a copy of the real-time depth buffer 345 rather than the actual depth buffer. The depth buffer 345 can be stored in a cache, in a memory, or in another location.

[0027] In one implementation, the culling unit 340 returns the result of the culling function to the shader core 320, and the shader core 320 determines whether and / or how to proceed with the draw call based on the result of the culling function. For example, in one implementation, if the culling unit 340 returns an indicator to the shader core 320 that the primitive should not be culled, the shader core 320 proceeds with the draw call for the primitive. After completing the draw call for the primitive, the shader core 320 exports the geometry to the rasterizer 330, which generates shaded pixels for the frame buffer (not shown). In another implementation, the rasterizer 330 transmits the pixels back to the shader core 320 for additional processing. If the culling unit 340 returns an indicator to the shader core 320 that a given primitive is occluded, the shader core 320 cancels the draw call for the given primitive. Note that the shader core 320 may issue overlapping culling requests to the culling unit 340 and have multiple pending culling requests. The shader core 320 tracks multiple outstanding culling requests that have been sent to the depth culling unit before receiving responses to these requests. Once a response to a given culling request has been received, the given culling request is retracted by the shader core 320.

[0028] Now turn to Figure 4 , which shows a specific implementation of a method 400 for executing a shader core instruction to invoke depth culling. For discussion purposes, the specific implementation and Figures 5 to 7 However, it should be noted that in various implementations of the described method, one or more of the described elements may be performed simultaneously, in a different order than shown, or omitted entirely. Other additional elements may also be performed as needed. Any of the various systems or devices described herein is configured to implement method 400.

[0029] The shader core receives a draw call (block 405). In one implementation, the draw call is for one or more primitives or a portion thereof. After receiving the draw call, the shader core executes instructions to call a culling function on a depth culling unit (block 410). Next, the depth culling unit executes the culling function called by the shader core instruction (block 415). In one implementation, the culling function determines whether a pixel, sub-pixel, fragment, or other portion of a primitive is closest to an observer or is obscured by a previously rendered pixel of another primitive. Note that a "culling function" may also be referred to as a "depth test" or an "occlusion culling function." In other implementations, other culling functions may be employed, such as frustum culling, backface culling, small primitive culling, depth limit culling, or functions for performing other types of culling operations. In general, a "culling function" is defined as a process for removing or deleting a primitive from subsequent shading operations when it is determined that the primitive will have no effect or relatively little effect (e.g., will not be visible) on the final image presented to the user.

[0030] Next, the depth culling unit sends the results of the culling function back to the shader core (block 420). For each query, if the depth culling unit indicates that culling should be performed (conditional block 425, "yes" branch), the shader core modifies or cancels the draw call (block 430). In block 430, the shader core may also discard any primitives associated with the draw call. This helps reduce the number of primitives that pass through and are processed by the shader core. Otherwise, if the depth culling unit indicates that culling should not be performed (conditional block 430, "yes" branch), the shader core continues with the draw call (block 435). It should be noted that the depth culling unit may update the depth buffer for those screen pixels that have new depth values ​​based on any visible primitives. After blocks 430 and 435, method 400 ends.

[0031] Reference now Figure 5 , which shows one specific implementation of a method 500 for executing a shader core instruction to invoke depth culling. The shader core executes an instruction to invoke a culling function for one or more entities (e.g., primitives, screen space rectangles) through a depth culling unit (block 505). As part of executing the instruction, the shader core sends at least the mode and coordinates of the one or more entities to the depth culling unit (block 510). For example, in one specific implementation, the shader core instruction includes the following parameters passed to the depth culling unit: geometry_cull_quad <output>,<screen minXY><screen max XY><depth min><depth max> In another specific implementation, the shader core instruction includes the following parameters passed to the depth culling unit: geometry_cull_triangle <output>,<vertex 0 XYZ> ,<vertex 1 XYZ> ,<vertex 2 XYZ> In other implementations, the shader core instruction includes other parameters and / or is formatted in other suitable ways.

[0032] Next, the depth culling unit accesses the real-time depth buffer to determine whether one or more primitives corresponding to the entity are occluded (block 515). The depth culling unit then returns a result (e.g., a Boolean result, a coverage value result) to the shader core for each primitive indicating whether the primitive should be culled (block 520). In one implementation, the depth culling unit returns a partial coverage value that is useful for selecting different levels of detail. For example, this may occur if the primitive is mostly occluded. After block 520, the method 500 ends. In one implementation, the shader core uses the result provided by the depth culling unit to determine whether to modify, cancel, or proceed with a draw call for one or more primitives.

[0033] Now turn to Figure 6 , which shows a specific implementation of a method 600 for converting a draw call into a culling function query. By a control unit (e.g., Figure 3 The control unit 305 of the embodiment of the present invention receives a draw call (block 605). The control unit may be implemented using any suitable combination of hardware and / or software. In response to receiving the draw call, the control unit issues a culling function query as part of the draw call (block 610). Next, in the culling unit (e.g., Figure 3 The culling function is executed on the culling unit 340 of the culling query (block 615). Based on the result of the query, the draw call or a portion of the draw call may be discarded or processed differently in the rest of the entire pipeline (block 620). In other words, if the result of the culling function indicates that one or more primitives (or a portion thereof) should be culled or processed differently, the shader core modifies the draw call accordingly for the one or more primitives. For example, an amplification shader may cancel a portion of a draw call based on the result of the culling query. As another example, a mesh shader may discard individual primitives based on the result of the culling query. Otherwise, if the result of the culling query indicates that the primitives should not be culled, the shader core executes the draw call for the primitives in an unmodified form. After block 620, the method 600 ends.

[0034] Reference now Figure 7 , which shows a specific implementation of a method 700 for synthesizing entities when generating a query for a culling unit. A draw call is transmitted from a graphics driver to a shader core (block 705). In one embodiment, a "draw call" is defined as a request to render one or more primitives, wherein the request is compatible with a graphics application programming interface (API). Next, the shader core synthesizes (i.e., calculates) an entity for querying the culling unit (block 710). In one embodiment, the entity is a screen space rectangle with an extent. For example, in one embodiment, the enlarged shader synthesizes a screen space bounding box that encapsulates one or more primitives referenced by the draw call. The shader core then sends a query to the culling unit, wherein the query includes or references the entity synthesized by the shader core (block 715). In one specific implementation, when the entity is a screen space bounding box, the query specifies a minimum and maximum value of the screen space bounding box.

[0035] The culling unit performs one or more tests on the entity in response to receiving the query (block 720). For example, in one implementation, when the entity defined by the query is a primitive, the culling unit checks the primitive against the Z plane (i.e., the depth plane). In another implementation, when the entity defined by the query is a screen space rectangle, the culling unit checks the rectangle against a hierarchical tile (HTile). The HTile stores depth information for a block of pixels (e.g., an 8x8 block of pixels). Next, the culling unit sends the results of the one or more tests to the shader core (block 725). The shader core then makes a culling decision based on the results of the one or more tests (block 730). For example, in one implementation, the shader core makes a decision about whether to modify a portion or all of a draw call based on the results received from the culling unit. In one implementation, a compute shader may decide to stop the entire draw call when performing indirect drawing based on the results. In another implementation, a geometry, hull, magnification, or compute shader may cull individual primitives. In other implementations, the geometry, hull, or magnification shader may decide to generate fewer or no primitives. For example, in this implementation, if the shader is rendering a terrain tile that is identified as being covered by a threshold amount (e.g., 90%), an approximation is performed using a relatively small number of triangles rather than generating a full mesh. In other implementations, other ways of responding to the culling unit results are possible and contemplated. After block 730, method 700 ends.

[0036] In various specific implementations, the program instructions of the software application are used to implement the methods and / or mechanisms described herein. For example, it is envisioned that the program instructions can be executed by a general-purpose processor or a special-purpose processor. In various specific implementations, such program instructions are represented by a high-level programming language. In other specific implementations, the program instructions are compiled from the high-level programming language into binary, intermediate or other forms. Alternatively, program instructions describing the behavior or design of the hardware are written. Such program instructions are represented by a high-level programming language such as C. Alternatively, a hardware design language (HDL) such as Verilog is used. In various specific implementations, the program instructions are stored on any non-transient computer-readable storage medium in a variety of non-transient computer-readable storage media. The storage medium can be accessed by a computing system during use to provide the computing system with program instructions for program execution. In general, such a computing system includes at least one or more memories and one or more processors configured to execute program instructions.

[0037] It should be emphasized that the above specific implementation is only a non-limiting example of a specific implementation. Once the above disclosure is fully understood, many variations and modifications will become apparent to those skilled in the art. It is intended that the following claims be interpreted as covering all such variations and modifications.< / output> < / output>

Claims

1. A device comprising: interface; and The pipeline comprises: a shader core configured to deliver output; a rasterizer following the shader core in the pipeline, the rasterizer being configured to receive the output from the shader core; and a culling unit coupled to the rasterizer; The shader core is configured as: Receive draw calls; In response to the draw call: Execute instructions to generate a culling function query; transmitting the culling function query to the culling unit; receiving a response to the culling function query from the culling unit; and determining whether to cancel based on the response received from the reject unit, Continue or modify the draw call. 2 . The apparatus of claim 1 , wherein the culling unit is configured to execute the culling function in response to the query to access a real-time depth buffer. 3 . The apparatus of claim 2 , wherein the culling unit is configured to execute the culling function on entities composited by the shader core. The apparatus of claim 1 , wherein the response comprises a Boolean value or an override value. 5 . The apparatus of claim 1 , wherein the shader core is further configured to provide a mode and coordinates to the culling unit as a result of executing the instruction. The apparatus of claim 1 , wherein the shader core comprises a mesh shader that executes the instructions. 7 . The apparatus of claim 1 , wherein the shader core is further configured to track a number of outstanding culling requests that have been sent to the culling unit.

8. A method comprising: The draw call is received by the shader core; In response to receiving the draw call: executing instructions by the shader core to generate a culling function query; transmitting the culling function query from the shader core to a culling unit for the draw call, wherein the culling unit follows the shader core in a pipeline; receiving a response to the culling function query from the culling unit; determining whether to cancel, continue, or modify the draw call based on a response to the query received from the culling unit via an interface; Data corresponding to rendered primitives is transferred from the shader core to a rasterizer that follows the shader core in the pipeline. 9 . The method of claim 8 , further comprising the culling unit executing the culling function in response to the query to access a real-time depth buffer.

10. The method of claim 9, further comprising the culling unit executing the culling function on entities composited by the shader core. The method of claim 8 , wherein the response comprises a Boolean value or an override value.

12. The method of claim 8, further comprising the shader core providing a mode and coordinates to the culling unit as a result of executing the instruction.

13. The method of claim 8, further comprising executing the instructions by a mesh shader.

14. The method of claim 8, further comprising the shader core tracking a number of outstanding culling requests that have been sent to the culling unit.

15. A system comprising: Eliminate units; Rasterizer; and A shader core, which is before the culling unit in the pipeline, the shader core is configured to: transmitting data corresponding to rendered primitives to the rasterizer via a first interface; Receive draw calls; In response to receiving the draw call: Execute instructions to generate a culling function query; transmitting the culling function query to the culling unit via a second interface different from the first interface; as well as A determination is made whether to cancel, continue, or modify the draw call based on a response to the query received from the culling unit via the second interface. 16 . The system of claim 15 , wherein the culling unit is configured to execute the culling function in response to the query to access a depth buffer.

17. The system of claim 16, wherein the culling unit is configured to execute the culling function on entities composited by the shader core. The system of claim 15 , wherein the response comprises a Boolean value or an override value.

19. The system of claim 15, wherein the shader core is further configured to provide a mode and coordinates to the culling unit as a result of executing the instruction.

20. The system of claim 15, wherein the shader core is further configured to track a number of outstanding culling requests that have been sent to the culling unit.