Apparatus and method for density aware random subsets for improved importance sampling

By introducing the collaborative work of ray tracing core and tensor core in the graphics processor, optimizing the construction and traversal of BVH solves the resource-intensive and low-efficiency problems in ray tracing technology, and achieves efficient ray-pixel intersection and density. Perceptual random subset sampling.

CN118710485APending Publication Date: 2024-09-27INTEL CORP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311852003.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-03-25
Filing Date
2023-12-29
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing ray tracing technology is resource-intensive in real-time execution, resulting in inefficient ray traversal and intersection operations, especially in the processing of density-aware random subsets, which creates performance bottlenecks.

Method used

Using an improved graphics processor architecture, through the collaborative work of ray tracing cores and tensor cores, the construction and traversal of the bounding volume hierarchy (BVH) is optimized, combined with distributed processing of multi-core groups, to improve the efficiency of ray-pixel intersection , and improve the sampling efficiency of density-aware random subsets through the ray tracing engine and sampling weight generator.

Benefits of technology

Significantly improves the real-time performance of ray tracing, reduces the computational complexity of ray traversal and intersection operations, improves the sampling efficiency of density-aware random subsets, reduces the occupation of system resources, and achieves more efficient graphics rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710485A
    Figure CN118710485A
Patent Text Reader

Abstract

An apparatus and method for density aware random subsets for improved importance sampling. For example, one embodiment of an apparatus includes a sampling weight generator to determine a plurality of sampling weights associated with a corresponding plurality of input primitives, a sampling weight generator to determine each sampling weight based on a surface area or diagonal of a bounding box of a corresponding input primitive and a plurality of distance values corresponding to distances between the input primitive and a corresponding plurality of adjacent input primitives; a sampler to identify a representative subset of input primitives based at least in part on the plurality of sampling weights; a bounding volume hierarchy (BVH) builder hardware logic to construct an approximate BVH based on the representative subset of input primitives; hardware logic to insert input primitives that are not in the representative subset into leaves of the approximate BVH; and the BVH builder, or a different BVH builder, for constructing a final BVH based on the primitives inserted into the leaves of the approximate BVH.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates generally to the field of graphics processors. More specifically, the present invention relates to an apparatus and method for density-aware stochastic subsets for improved importance sampling. Background Art

[0002] Ray tracing is a technique in which light transport is simulated via physically based rendering. Although widely used in film rendering, until just a few years ago it was considered too resource intensive for real-time execution. One of the key operations in ray tracing is visibility queries for ray-scene intersections known as "ray traversals", which compute ray-scene intersections by traversing and intersecting nodes in a bounding volume hierarchy (BVH).

[0003] Rasterization is a technique in which screen objects are created from 3D models of objects created from a mesh of triangles. The vertices of each triangle intersect with the vertices of other triangles of different shapes and sizes. Each vertex has a position in space and information about color, texture, and its normal, which is used to determine the direction the surface of the object is facing. The rasterizer converts the triangles of the 3D model into pixels in 2D screen space, and each pixel can be assigned an initial color value based on the vertex data. BRIEF DESCRIPTION OF THE DRAWINGS

[0004] A better understanding of the present invention may be obtained from the following specific embodiments in conjunction with the following drawings, in which:

[0005] Figure 1 is a block diagram of a processing system according to an embodiment;

[0006] Figure 2A is a block diagram of an embodiment of a processor having one or more processor cores, an integrated memory controller, and an integrated graphics processor;

[0007] Figure 2B is a block diagram of the hardware logic of a graphics processor core block according to some embodiments described herein;

[0008] Figure 2C The illustration includes a graphics processing unit (GPU) comprising a dedicated collection of graphics processing resources arranged as a multi-core group;

[0009] Figure 2D is a block diagram of a general purpose graphics processing unit (GPGPU) that may be configured as a graphics processor and / or a computing accelerator according to embodiments described herein;

[0010] Figure 3A is a block diagram of a graphics processor, which may be a discrete graphics processing unit, or may be a graphics processor integrated with multiple processing cores or other semiconductor devices such as, but not limited to, a memory device or a network interface.

[0011] Figure 3B illustrates a graphics processor having a tiled architecture according to embodiments described herein;

[0012] Figure 3C illustrates a computing accelerator according to embodiments described herein;

[0013] Figure 4 is a block diagram of a graphics processing engine of a graphics processor according to some embodiments;

[0014] Figure 5A illustrates a graphics core cluster according to an embodiment;

[0015] Figure 5B illustrates a vector engine of a graphics core according to an embodiment;

[0016] Figure 5C illustrates a matrix engine of a graphics core according to an embodiment;

[0017] Figure 6 FIG. 1 illustrates a tile of a multi-chip processor according to an embodiment;

[0018] Figure 7 is a block diagram illustrating a graphics processor instruction format according to some embodiments;

[0019] Figure 8 is a block diagram of another embodiment of a graphics processor;

[0020] Fig.9A is a block diagram illustrating a graphics processor command format that may be used to program a graphics processing pipeline according to some embodiments;

[0021] Fig. 9B is a block diagram illustrating a graphics processor command sequence according to an embodiment;

[0022] Fig.10 illustrates an exemplary graphical software architecture for a data processing system according to some embodiments;

[0023] Fig.11A is a block diagram illustrating an IP core development system that may be used to manufacture an integrated circuit to perform operations according to an embodiment;

[0024] Fig. 11BIllustrated is a cross-sectional side view of an integrated circuit package assembly according to some embodiments described herein.

[0025] Fig. 11C A package assembly including multiple hardware logic chiplets connected to a substrate is shown;

[0026] Fig.11D illustrates a package assembly including interchangeable chiplets according to an embodiment;

[0027] Fig.12 is a block diagram illustrating an exemplary system-on-chip integrated circuit that may be fabricated using one or more IP cores according to an embodiment;

[0028] Fig.13 illustrates an exemplary graphics processor of a system-on-chip integrated circuit that may be fabricated using one or more IP cores in accordance with an embodiment;

[0029] Fig.14 illustrates additional exemplary graphics processors of system-on-chip integrated circuits that may be fabricated using one or more IP cores in accordance with an embodiment;

[0030] Fig.15 The diagram includes the processing architecture of the ray tracing cores and tensor cores;

[0031] Fig.16 illustrates an example of a distributed ray tracing engine;

[0032] Figure 17-18 Illustration of compression performed in a ray tracing system;

[0033] Fig.19 The method implemented on the ray tracing architecture is illustrated;

[0034] Fig. 20 An exemplary hybrid ray tracing device is shown;

[0035] Fig.21 Diagram of the stack used for ray tracing operations;

[0036] Fig. 22 Figure 2 shows additional details of the hybrid ray tracing device;

[0037] Fig.23 Diagrammatically shows the bounding volume hierarchy;

[0038] Fig.24 Diagram of call stack and traversal state storage;

[0039] Fig.25 Graph traversal and intersection methods;

[0040] Fig.26A-B illustrates how multiple dispatch cycles are required to execute some shaders;

[0041] Fig. 27 Diagram showing how a single dispatch loop can execute multiple shaders;

[0042] Fig.28 Diagram showing how a single dispatch loop can execute multiple shaders;

[0043] Fig.29 illustrates an architecture for executing ray tracing instructions;

[0044] Fig.30 illustrates a method for executing ray tracing instructions within a thread;

[0045] Fig.31 illustrates one embodiment of an architecture for asynchronous ray tracing;

[0046] Fig.32A An embodiment of a ray traversal circuit is illustrated;

[0047] Fig.32B Figure 1 illustrates a process performed in one embodiment for managing a light storage bank;

[0048] Fig.33 One embodiment of a priority selection circuit / logic is illustrated;

[0049] Fig.34 An embodiment of a level of detail selector with an N-bit comparison operation mask is illustrated;

[0050] Fig.35 illustrates a ray tracing engine according to one embodiment;

[0051] Fig.36 illustrates a BVH compressor according to one embodiment;

[0052] Fig.37A An embodiment of a slice resource is shown;

[0053] Fig.37B A method according to an embodiment of the present invention is illustrated;

[0054] Fig.38A An embodiment of BVH processing logic including an on-demand builder is illustrated;

[0055] Fig.38B illustrates one embodiment of an on-demand builder for accelerating structures;

[0056] Fig.38C An embodiment of a bottom-level acceleration structure diagram is shown in the figure;

[0057] Fig.38D Illustrate different types of instances and traversal decisions;

[0058] Fig.39 illustrates one embodiment of a material based culling mask;

[0059] Fig.40A One embodiment of a ray tracing architecture is illustrated;

[0060] Fig.40B The diagram includes an embodiment of meshlet compression;

[0061] Fig.41 The diagram shows multiple threads, including synchronization threads, diverging spawn threads, regular spawn threads, and converging spawn threads;

[0062] Fig.42 illustrates one embodiment of a ray tracing architecture with an unbound thread dispatcher;

[0063] Fig.43 illustrates a ray tracing cluster according to one embodiment;

[0064] Figure 44-51 illustrates an embodiment of using proxy data in a multi-node ray tracing implementation;

[0065] Fig.52 A method according to an embodiment of the present invention is illustrated;

[0066] Fig.53A -B illustrates an analysis of the construction time speedup relative to a top down builder;

[0067] Fig.54 Illustrate an apparatus and method according to an embodiment of the present invention;

[0068] Fig.55 Illustrate the association between spatially ordered primitives, primitive subsets, and leaf nodes according to an embodiment of the present invention;

[0069] Fig.56 An apparatus and method including a sampling weight generator according to an embodiment of the present invention are illustrated;

[0070] Fig.57 A method for determining primitive weights according to an embodiment of the present invention is illustrated;

[0071] Fig.58 illustrates a method for improving latency of BVH construction using random selection of a representative sample of primitives; and

[0072] Fig.59 A ray tracing engine according to an embodiment of the present invention is illustrated. DETAILED DESCRIPTION

[0073] In the following description, for purposes of explanation, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention described below. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without some of these specific details. In other instances, well-known structures and devices are shown in block diagram form to avoid obscuring the underlying principles of the embodiments of the invention.

[0074] Exemplary Graphics Processor Architectures and Data Types

[0075] System Overview

[0076] Figure 1 1 is a block diagram of a processing system 100 according to an embodiment. The processing system 100 may be used in a single-processor desktop computer system, a multi-processor workstation system, or a server system having a large number of processors 102 or processor cores 107. In one embodiment, the processing system 100 is a processing platform incorporated within a system-on-a-chip (SoC) integrated circuit for use in a mobile device, handheld device, or embedded device, such as for use within an Internet-of-things (IoT) device having wired or wireless connectivity to a local area network or a wide area network.

[0077] In one embodiment, the processing system 100 may include, be coupled with, or be incorporated into a server-based gaming platform, a gaming console including a gaming and media console, a mobile gaming console, a handheld gaming console, or an online gaming console. In some embodiments, the processing system 100 is part of a mobile phone, a smart phone, a tablet computing device, or a mobile Internet-connected device such as a notebook with low internal storage capacity. The processing system 100 may also include, be coupled with, or be integrated into a wearable device such as a smart watch wearable device; smart glasses or clothing enhanced with augmented reality (AR) or virtual reality (VR) features to provide visual, audio, or tactile output to supplement the real-world visual, audio, or tactile experience or otherwise provide text, audio, graphics, video, holographic images or video, or tactile feedback; other augmented reality (AR) devices; or other virtual reality (VR) devices. In some embodiments, the processing system 100 includes a television or set-top box device, or is part of a television or set-top box device. In one embodiment, processing system 100 may include, be coupled to, or be integrated in an autonomous vehicle, such as a bus, a tractor trailer, an automobile, a motor or electric power cycle, an airplane, or a glider (or any combination thereof). The autonomous vehicle may use processing system 100 to process the environment sensed around the vehicle.

[0078] In some embodiments, one or more processors 102 each include one or more processor cores 107 for processor instructions, which, when executed, perform operations for system or user software. In some embodiments, at least one of the one or more processor cores 107 is configured to process a specific instruction set 109. In some embodiments, the instruction set 109 may facilitate complex instruction set computing (CISC), reduced instruction set computing (RISC), or computing via very long instruction words (VLIW). One or more processor cores 107 may process different instruction sets 109, which may include instructions for facilitating emulation of other instruction sets. The processor core 107 may also include other processing devices, such as a digital signal processor (DSP).

[0079] In some embodiments, the processor 102 includes a cache memory 104. Depending on the architecture, the processor 102 may have a single internal cache or multiple levels of internal cache. In some embodiments, the cache memory is shared between various components of the processor 102. In some embodiments, the processor 102 also uses an external cache (e.g., a level 3 (L3) cache or a last level cache (LLC)) (not shown), which can be shared between the processor cores 107 using known cache coherence techniques. A register file 106 may additionally be included in the processor 102, and the register file 106 may include different types of registers (e.g., integer registers, floating point registers, status registers, and instruction pointer registers) for storing different types of data. Some registers may be general purpose registers, while other registers may be specific to the design of the processor 102.

[0080] In some embodiments, one or more processors 102 are coupled to one or more interface buses 110 to transmit communication signals, such as address, data, or control signals, between the processor 102 and other components in the processing system 100. In one embodiment, the interface bus 110 can be a processor bus, such as a version of a Direct Media Interface (DMI) bus. However, the processor bus is not limited to the DMI bus and may include one or more peripheral component interconnect buses (e.g., PCI, PCI express), memory buses, or other types of interface buses. In one embodiment, the processor (s) 102 include a memory controller 116 and a platform controller hub 130. The memory controller 116 facilitates communication between memory devices and other components of the processing system 100, while the platform controller hub (PCH) 130 provides connections to I / O devices via a local I / O bus. The memory device 120 may be a dynamic random access memory (DRAM) device, a static random access memory (SRAM) device, a flash memory device, a phase change memory device, or some other memory device having appropriate performance to act as a process memory. In one embodiment, the memory device 120 may operate as a system memory for the processing system 100 to store data 122 and instructions 121 for use when one or more processors 102 execute applications or processes. The memory controller 116 is also coupled to an optional external graphics processor 118, which may communicate with one or more graphics processors 108 in the processor 102 to perform graphics operations and media operations. In some embodiments, graphics operations, media operations, or computing operations may be assisted by an accelerator 112, which is a coprocessor that can be configured to perform a collection of specialized graphics operations, media operations, or computing operations. For example, in one embodiment, the accelerator 112 is a matrix multiplication accelerator for optimizing machine learning or computing operations. In one embodiment, accelerator 112 is a ray tracing accelerator that can be used to perform ray tracing operations in coordination with graphics processor 108. In one embodiment, external accelerator 119 can be used instead of accelerator 112 or can be used in coordination with accelerator 112.

[0081] In some embodiments, display device 111 may be connected to processor(s) 102. Display device 111 may be one or more of: an internal display device, such as in a mobile electronic device or laptop device; or an external display device attached via a display interface (e.g., display port, etc.). In one embodiment, display device 111 may be a head mounted display (HMD), such as a stereoscopic display device for use in virtual reality (VR) applications or augmented reality (AR) applications.

[0082] In some embodiments, the platform controller hub 130 enables peripheral devices to be connected to the memory device 120 and the processor 102 via a high-speed I / O bus. The I / O peripherals include, but are not limited to, an audio controller 146, a network controller 134, a firmware interface 128, a wireless transceiver 126, a touch sensor 125, a data storage device 124 (e.g., non-volatile memory, volatile memory, hard drive, flash memory, NAND, 3D NAND, 3D XPoint, etc.). The data storage device 124 can be connected via a storage interface (e.g., SATA) or via a peripheral bus such as a peripheral component interconnect bus (e.g., PCI, PCI Express). The touch sensor 125 can include a touch screen sensor, a pressure sensor, or a fingerprint sensor. The wireless transceiver 126 can be a Wi-Fi transceiver, a Bluetooth transceiver, or a mobile network transceiver such as a 3G, 4G, 5G or Long-Term Evolution (LTE) transceiver. The firmware interface 128 enables communication with the system firmware and can be, for example, a unified extensible firmware interface (UEFI). The network controller 134 can enable a network connection to a wired network. In some embodiments, a high-performance network controller (not shown) is coupled to the interface bus 110. In one embodiment, the audio controller 146 is a multi-channel high-definition audio controller. In one embodiment, the processing system 100 includes an optional traditional I / O controller 140 for coupling a traditional (e.g., Personal System 2 (PS / 2)) device to the system. The platform controller hub 130 can also be connected to one or more Universal Serial Bus (USB) controllers 142 to connect to input devices, such as a keyboard and mouse 143 combination, a camera 144, or other USB input devices. It will be understood that the processing system 100 shown is exemplary and not restrictive, as other types of data processing systems configured in different ways can also be used. For example, instances of the memory controller 116 and the platform controller hub 130 may be integrated into a discrete external graphics processor, such as the external graphics processor 118. In one embodiment, the platform controller hub 130 and / or the memory controller 116 may be external to the processor(s) 102 and reside in a system chipset that communicates with the processor(s) 102.

[0083] For example, a circuit board ("sled") can be used, on which components (such as CPU, memory and other components) are placed, and the circuit board is designed for increased thermal performance. In some examples, processing components such as processors are located on the top side of the sled, and nearby memories such as DIMMs are located on the bottom side of the sled. As a result of the enhanced airflow provided by the design, the components can operate at higher frequencies and power levels than typical systems, thereby increasing performance. In addition, the sled is configured to blindly match power and data communication cables in the rack, thereby enhancing their ability to be quickly removed, upgraded, reinstalled and / or replaced. Similarly, the various components (such as processors, accelerators, memory and data storage devices) located on the sled are configured to be easy to upgrade due to their increased spacing relative to each other. In an illustrative embodiment, the components additionally include hardware authentication features for proving their authenticity.

[0084] The data center may utilize a single network architecture ("fabric") that supports multiple other network architectures, including Ethernet and Omni-Path. The sleds may be coupled to the switches via optical fiber, which provides higher bandwidth and lower latency than typical twisted pair cabling (e.g., Category 5, Category 5e, Category 6, etc.). Due to the high-bandwidth, low-latency interconnect and network architecture, the data center may, in use, concentrate physically disaggregated resources such as memory, accelerators (e.g., GPUs, graphics accelerators, FPGAs, ASICs, neural network and / or artificial intelligence accelerators, etc.) and data storage drives, and provide them to computing resources (e.g., processors) as needed, thereby enabling the computing resources to access the concentrated resources as if the concentrated resources were local.

[0085] A power supply or power source may provide voltage and / or current to the processing system 100 or any component or system described herein. In one example, the power supply includes an AC-DC (alternating current-direct current) adapter for plugging into a wall socket. Such AC power may be a renewable energy (e.g., solar) power source. In one example, the power source includes a DC power source, such as an external AC-DC converter. In one example, the power source or power supply includes wireless charging hardware for charging by approaching a charging field. In one example, the power source may include an internal battery, an AC supply, a motion-based power supply, a solar power supply, or a fuel cell source.

[0086] Figure 2A-2D Illustrated is a computing system and graphics processor provided by embodiments described herein. Figure 2A-2DThose elements having the same reference numerals (or names) as elements of any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto.

[0087] Figure 2A 2 is a block diagram of an embodiment of a processor 200 having one or more processor cores 202A-202N, an integrated memory controller 214, and an integrated graphics processor 208. The processor 200 may include additional cores up to and including the additional core 202N represented by the dashed box. Each of the processor cores 202A-202N includes one or more internal cache units 204A-204N. In some embodiments, each processor core also has access to one or more shared cache units 206. The internal cache units 204A-204N and the shared cache units 206 represent a cache memory hierarchy within the processor 200. The cache memory hierarchy may include at least one level of instruction and data cache within each processor core and one or more levels of shared mid-level cache, such as level 2 (L2), level 3 (L3), level 4 (L4), or other levels of cache, where the highest level of cache before the external memory is classified as LLC. In some embodiments, cache coherency logic maintains coherency between cache units 206 and 204A-204N.

[0088] In some embodiments, the processor 200 may also include a set of one or more bus controller units 216 and a system agent core 210. The one or more bus controller units 216 manage a set of peripheral buses, such as one or more PCI buses or PCI Express buses. The system agent core 210 provides management functions for various processor components. In some embodiments, the system agent core 210 includes one or more integrated memory controllers 214 for managing access to various external memory devices (not shown).

[0089] In some embodiments, one or more of the processor cores 202A-202N include support for simultaneous multithreading. In such embodiments, the system agent core 210 includes components for coordinating and operating the cores 202A-202N during multithreaded processing. The system agent core 210 may additionally include a power control unit (PCU) that includes logic and components for regulating the power state of the processor cores 202A-202N and the graphics processor 208.

[0090] In some embodiments, the processor 200 additionally includes a graphics processor 208 for performing graphics processing operations. In some embodiments, the graphics processor 208 is coupled to the set of shared cache units 206 and to a system agent core 210, which includes one or more integrated memory controllers 214. In some embodiments, the system agent core 210 also includes a display controller 211 for driving the graphics processor output to one or more coupled displays. In some embodiments, the display controller 211 may also be a separate module coupled to the graphics processor via at least one interconnect, or may be integrated within the graphics processor 208.

[0091] In some embodiments, a ring-based interconnect 212 is used to couple internal components of the processor 200. However, alternative interconnect units may be used, such as point-to-point interconnects, switched interconnects, mesh interconnects, or other technologies, including those known in the art. In some embodiments, the graphics processor 208 is coupled to the ring-based interconnect 212 via an I / O link 213. The exemplary I / O link 213 represents at least one of a plurality of various I / O interconnects, including an on-package I / O interconnect that facilitates communication between various processor components and a high-performance embedded memory module 218, such as an eDRAM module or a high-bandwidth memory (HBM) module. In some embodiments, each of the processor cores 202A-202N and the graphics processor 208 may use the embedded memory module 218 as a shared last-level cache.

[0092] In some embodiments, the processor cores 202A-202N are isomorphic cores that execute the same instruction set architecture. In another embodiment, the processor cores 202A-202N are heterogeneous in terms of instruction set architecture (ISA), wherein one or more of the processor cores 202A-202N execute a first instruction set, while at least one of the other cores executes a subset of the first instruction set or a different instruction set. In one embodiment, the processor cores 202A-202N are heterogeneous in terms of microarchitecture, wherein one or more cores with relatively high power consumption are coupled with one or more power cores with lower power consumption. In one fact, the processor cores 202A-202N are heterogeneous in terms of computing power. In addition, the processor 200 may be implemented on one or more chips, or as a SoC integrated circuit having the components illustrated in addition to other components.

[0093] Figure 2B is a block diagram of the hardware logic of the graphics processor core block 219 according to some embodiments described herein. In some embodiments, Figure 2BThose elements having the same reference numerals (or names) as elements of any other figure herein may operate or function in a manner similar to that described elsewhere herein. Graphics processor core block 219 is an example of a partition of a graphics processor. Graphics processor core block 219 may be included in Figure 2A The graphics processor described herein may include multiple graphics core blocks based on target power and performance envelopes. Each graphics processor core block 219 may include a functional block 230 coupled to multiple graphics cores 221A-221F, which include modular blocks of fixed function logic and general programmable logic. The graphics processor core block 219 also includes a shared / cache memory 236 accessible by all graphics cores 221A-221F, a rasterizer logic 237, and additional fixed function logic 238. In some embodiments, the functional block 230 includes a geometry / fixed function pipeline 231, which can be shared by all graphics cores in the graphics processor core block 219. In various embodiments, the geometry / fixed function pipeline 231 includes a 3D geometry pipeline, a video front end unit, a thread generator and a global thread dispatcher, and a unified return buffer manager that manages a unified return buffer. In one embodiment, the functional block 230 also includes a graphics SoC interface 232, a graphics microcontroller 233, and a media pipeline 234. The graphics SoC interface 232 provides an interface between the graphics processor core block 219 and other core blocks within the graphics processor or computing accelerator SoC. The graphics microcontroller 233 is a programmable subprocessor that can be configured to manage various functions of the graphics processor core block 219, including thread dispatching, scheduling, and preemption. The media pipeline 234 includes logic for facilitating decoding, encoding, preprocessing, and / or post-processing of multimedia data including image data and video data. The media pipeline 234 implements media operations via requests to the calculation or sampling logic within the graphics core 221A-221F. One or more pixel backends 235 may also be included in the functional block 230. The pixel backend 235 includes a cache memory that stores pixel color values, and can perform blending operations and lossless color compression of rendered pixel data.

[0094] In one embodiment, the graphics SoC interface 232 enables the graphics processor core block 219 to communicate with a general application processor core (e.g., CPU) and / or other components within the SoC or a system host CPU coupled to the SoC via a peripheral interface. The graphics SoC interface 232 also enables communication with off-chip memory hierarchy elements such as shared last-level cache memory, system RAM, and / or embedded on-chip or packaged DRAM. The SoC interface 232 may also enable communication with fixed-function devices such as camera imaging pipelines within the SoC, and enable the use and / or implementation of global memory atomicity, which may be shared between the graphics processor core block 219 and the CPU within the SoC. The graphics SoC interface 232 may also implement power management control for the graphics processor core block 219, and enable an interface between the clock domain of the graphics processor core block 219 and other clock domains within the SoC. In one embodiment, the graphics SoC interface 232 enables receiving a command buffer from a command streamer and a global thread dispatcher, which is configured to provide commands and instructions to each of the one or more graphics cores within the graphics processor. When media operations are to be performed, these commands and instructions may be dispatched to the media pipeline 234, and when graphics processing operations are to be performed, these commands and instructions may be dispatched to the geometry and fixed function pipeline 231. When compute operations are to be performed, the compute dispatch logic may dispatch these commands to the graphics cores 221A-221F, thereby bypassing the geometry and media pipelines.

[0095] The graphics microcontroller 233 may be configured to perform various scheduling and management tasks for the graphics processor core block 219. In one embodiment, the graphics microcontroller 233 may perform graphics and / or computational workload scheduling on the various vector engines 222A-222F, 224A-224F and matrix engines 223A-223F, 225A-225F within the graphics core 221A-221F. In this scheduling model, host software executing on a CPU core of a SoC including the graphics processor core block 219 may submit a workload to one of a plurality of graphics processor doorbells, which invokes a scheduling operation to the appropriate graphics engine. The scheduling operation includes determining which workload to run next, submitting the workload to the command streamer, preempting an existing workload running on an engine, monitoring the progress of the workload, and notifying the host software when the workload is completed. In one embodiment, the graphics microcontroller 233 may also facilitate a low power or idle state for the graphics processor core block 219, thereby providing the graphics processor core block 219 with the ability to save and restore registers within the graphics processor core block 219 across low power state transitions independent of the operating system and / or graphics driver software on the system. The graphics processor core block 219 may have more or fewer than the illustrated graphics cores 221A-221F, up to N modular graphics cores. For each set of N graphics cores, the graphics processor core block 219 may also include a shared / cache memory 236 (which may be configured as a shared memory or a cache memory), a rasterizer logic 237, and additional fixed function logic 238 to accelerate various graphics and compute processing operations.

[0096] Within each graphics core 221A-221F is a collection of execution resources that can be used to perform graphics operations, media operations, and compute operations in response to requests made by the graphics pipeline, media pipeline, or shader programs. Graphics cores 221A-221F include: multiple vector engines 222A-222F, 224A-224F, matrix acceleration units 223A-223F, 225A-225D, cache / shared local memory (SLM), samplers 226A-226F, and ray tracing units 227A-227F.

[0097] The vector engines 222A-222F, 224A-224F are general purpose graphics processing units capable of performing floating point and integer / fixed point logic operations to serve graphics operations, media operations, or compute operations (including graphics programs, media programs, or compute / GPGPU programs). The vector engines 222A-222F, 224A-224F can operate with variable vector widths using SIMD, SIMT, or SIMT+SIMD execution modes. The matrix acceleration units 223A-223F, 225A-225D include matrix-matrix and matrix-vector acceleration logic that improves performance on matrix operations, particularly low-precision and mixed-precision (e.g., INT8, FP16, BF16) matrix operations for machine learning. In one embodiment, each of the matrix acceleration units 223A-223F, 225A-225D includes one or more systolic arrays of processing elements that can perform concurrent matrix multiplication or dot product operations on matrix elements.

[0098] Samplers 226A-226F may read media or texture data into memory and may sample the data differently based on the configured sampler state and the texture / media format being read. Threads executing on vector engines 222A-222F, 224A-224F or matrix acceleration units 223A-223F, 225A-225D may utilize caches / SLMs 228A-228F within each execution core. Caches / SLMs 228A-228F may be configured as cache memory or a shared memory pool that is local to each of the corresponding graphics cores 221A-221F. Ray tracing units 227A-227F within graphics cores 221A-221F include ray traversal / intersection circuitry for performing ray traversals using a bounding volume hierarchy (BVH) and identifying intersections between rays and primitives enclosed within the BVH. In one embodiment, the ray tracing units 227A-227F include circuitry for performing depth testing and culling (e.g., using a depth buffer or similar arrangement). In one implementation, the ray tracing units 227A-227F perform traversal and intersection operations in conjunction with image denoising, at least a portion of which operations may be performed using associated matrix acceleration units 223A-223F, 225A-225D.

[0099] Figure 2C A graphics processing unit (GPU) 239 is shown, which includes a dedicated set of graphics processing resources arranged as multi-core groups 240A-240N. Details of multi-core group 240A are shown. Other multi-core groups 240B-240N may be equipped with the same or similar set of graphics processing resources.

[0100] As illustrated, multi-core group 240A may include a set of graphics cores 243, a set of tensor cores 244, and a set of ray tracing cores 245. Scheduler / dispatcher 241 schedules and dispatches graphics threads for execution on the various cores 243, 244, 245. In one embodiment, tensor core 244 is a sparse tensor core having hardware that enables bypassing of multiplication operations with zero-valued inputs. Figure 2C GPU 239 graphics core 243 relative to Figure 2B The graphics cores 221A-221F differ in the level of abstraction. Figure 2B The graphics core 221A-221F is similar to Figure 2C The multi-core group 240A-240N. Figure 2C The graphics core 243, tensor core 244 and ray tracing core 245 are similar to Figure 2B Vector engines 222A-222F, 224A-224F, matrix engines 223A-223F, 225A-225F and ray tracing units 227A-227F.

[0101] The set of register files 242 may store operand values ​​used by the cores 243, 244, 245 when executing a graphics thread. These register files may include, for example, integer registers for storing integer values, floating point registers for storing floating point values, vector registers for storing packed data elements (integer and / or floating point data elements), and slice registers for storing tensor / matrix values. In one embodiment, the slice registers are implemented as a combined set of vector registers.

[0102] One or more combined first level (L1) caches and shared memory units 247 store graphics data locally within each multi-core group 240A, such as texture data, vertex data, pixel data, light data, bounding volume data, etc. One or more texture units 247 can also be used to perform texture operations, such as texture mapping and sampling. A second level (L2) cache 253 shared by all multi-core groups 240A-240N or a subset of multi-core groups 240A-240N stores graphics data and / or instructions for multiple concurrent graphics threads. As illustrated, the L2 cache 253 can be shared across multiple multi-core groups 240A-240N. One or more memory controllers 248 couple the GPU 239 to a memory 249, which can be system memory (e.g., DRAM) and / or dedicated graphics memory (e.g., GDDR6 memory).

[0103] Input / output (I / O) circuitry 250 couples GPU 239 to one or more I / O devices 252, such as a digital signal processor (DSP), a network controller, or a user input device. On-chip interconnects may be used to couple I / O devices 252 to GPU 239 and memory 249. One or more I / O memory management units (IOMMUs) 251 of I / O circuitry 250 directly couple I / O devices 252 to memory 249. In one embodiment, IOMMU 251 manages page tables for mapping virtual addresses to multiple sets of physical addresses in memory 249. In this embodiment, I / O devices 252, CPU(s) 246, and GPU 239 may share the same virtual address space.

[0104] In one implementation, IOMMU 251 supports virtualization. In this case, IOMMU 251 may manage a first set of page tables for mapping guest / graphics virtual addresses to guest / graphics physical addresses and a second set of page tables for mapping guest / graphics physical addresses to system / host physical addresses (e.g., within memory 249). The base address of each of the first set of page tables and the second set of page tables may be stored in a control register and swapped out upon context switch (e.g., so that the new context is provided with access to the relevant set of page tables). Although not described in detail in the prior art, the IOMMU 251 may be used to map guest / graphics virtual addresses to guest / graphics physical addresses and to map guest / graphics physical addresses to system / host physical addresses (e.g., within memory 249). Figure 2C , but each of the cores 243, 244, 245 and / or multi-core groups 240A-240N may include a translation backside buffer (TLB) for caching guest virtual to guest physical translations, guest physical to host physical translations, and guest virtual to host physical translations.

[0105] In one embodiment, CPU 246, GPU 239, and I / O devices 252 are integrated on a single semiconductor chip and / or chip package. Memory 249 may be integrated on the same chip, or may be coupled to memory controller 248 via an off-chip interface. In one implementation, memory 249 includes GDDR6 memory that shares the same virtual address space as other physical system-level memory, although the underlying principles of the embodiments described herein are not limited to this particular implementation.

[0106] In one embodiment, the tensor core 244 includes a plurality of functional units specifically designed to perform matrix operations, which are the basic computational operations for performing deep learning operations. For example, synchronized matrix multiplication operations can be used for neural network training and inference. The tensor core 244 can perform matrix processing using a variety of operand precisions, including single-precision floating point (e.g., 32 bits), half-precision floating point (e.g., 16 bits), integer words (16 bits), bytes (8 bits), and half bytes (4 bits). In one embodiment, a neural network implementation extracts features of each rendered scene, potentially combining details from multiple frames to construct a high-quality final image.

[0107] In a deep learning implementation, parallel matrix multiplication work may be scheduled for execution on the tensor core 244. The training of neural networks in particular requires a large number of matrix dot product operations. To handle the inner product formulation of an N×N×N matrix multiplication, the tensor core 244 may include at least N dot product processing elements. Before the matrix multiplication begins, a complete matrix is ​​loaded into the slice register, and for each of the N cycles, at least one column of the second matrix is ​​loaded. For each cycle, there are N dot products that are processed.

[0108] Depending on the specific implementation, matrix elements can be stored in different precisions, including 16-bit words, 8-bit bytes (e.g., INT8), and 4-bit nibbles (e.g., INT4). Different precision modes can be specified for the tensor cores 244 to ensure that the most efficient precision is used for different workloads (e.g., such as inference workloads, which can tolerate quantization to bytes and to nibbles).

[0109] In one embodiment, the ray tracing core 245 accelerates ray tracing operations for both real-time ray tracing implementations and non-real-time ray tracing implementations. Specifically, the ray tracing core 245 includes a ray traversal / intersection circuit that uses a bounding volume hierarchy (BVH) to perform ray traversals and identify intersections between rays and primitives enclosed within the BVH. The ray tracing core 245 may also include circuits for performing depth testing and culling (e.g., using a Z buffer or similar arrangement). In one implementation, the ray tracing core 245 performs traversal operations and intersection operations in conjunction with the image denoising techniques described herein, at least a portion of which may be performed on the tensor core 244. For example, in one embodiment, the tensor core 244 implements a deep learning neural network to perform denoising on frames generated by the ray tracing core 245. However, (one or more) CPUs 246, graphics cores 243, and / or ray tracing cores 245 may also implement all or part of the denoising and / or deep learning algorithms.

[0110] In addition, as described above, a distributed approach to denoising may be employed in which the GPU 239 is in a computing device coupled to other computing devices via a network or high-speed interconnect. In this embodiment, the interconnected computing devices share neural network learning / training data to improve the speed at which the entire system learns to perform denoising for different types of image frames and / or different graphics applications.

[0111] In one embodiment, the ray tracing core 245 handles all BVH traversals and ray-primitive intersections, thereby preventing the graphics core 243 from being overloaded with thousands of instructions for each ray. In one embodiment, each ray tracing core 245 includes a first set of specialized circuits for performing bounding box tests (e.g., for traversal operations) and a second set of specialized circuits for performing ray-triangle intersection tests (e.g., intersecting rays that have been traversed). Thus, in one embodiment, the multi-core group 240A can simply initiate ray detection, and the ray tracing core 245 independently performs ray traversals and intersections and returns hit data (e.g., hits, no hits, multiple hits, etc.) to the thread context. While the ray tracing core 245 performs traversal and intersection operations, the other cores 243, 244 are freed up to perform other graphics or computational work.

[0112] In one embodiment, each ray tracing core 245 includes a traversal unit for performing BVH test operations and an intersection unit for performing ray-primitive intersection tests. The intersection unit generates a "hit", "no hit", or "multiple hits" response, which it provides to the appropriate thread. During traversal and intersection operations, execution resources of other cores (e.g., graphics core 243 and tensor core 244) are freed up to perform other forms of graphics work.

[0113] In one particular embodiment described below, a hybrid rasterization / ray tracing approach is used in which the work is distributed between graphics core 243 and ray tracing core 245 .

[0114] In one embodiment, the ray tracing core 245 (and / or other cores 243, 244) includes hardware support for ray tracing instruction sets, such as Microsoft's DirectX Ray Tracing (DXR), which includes the DispatchRays command; and ray generation shaders, nearest hit shaders, any hit shaders, and miss shaders, which enable the assignment of a unique set of shaders and textures to each object. Another ray tracing platform that can be supported by the ray tracing core 245, graphics core 243, and tensor core 244 is Vulkan 1.1.85. However, it is to be noted that the underlying principles of the embodiments described herein are not limited to any particular ray tracing ISA.

[0115] In general, each core 245, 244, 243 may support a ray tracing instruction set including instructions / functions for: ray generation, nearest hit, any hit, ray-primitive intersection, per-primitive and hierarchy bounding box construction, misses, visits, and exceptions. More specifically, one embodiment includes ray tracing instructions for performing the following functions:

[0116] Light Generation (Ray Generation) - Ray generation instructions can be executed for each pixel, sample, or other user-defined work distribution.

[0117] Recent Hits (Closest Hit) - A closest hit command can be executed to locate the closest intersection of a ray and a primitive within the scene. Any hit (Any Hit) – The Any Hit instruction identifies multiple intersections between rays and primitives within the scene, potentially identifying a new closest intersection point.

[0118] intersect (Intersection)——The intersection command performs a ray-primitive intersection test and outputs the result.

[0119] Construct bounding box per primitive (Per-primitive Bounding box Construction) - This instruction builds a bounding box around a given primitive or group of primitives (for example, when building a new BVH or other acceleration data structure).

[0120] miss (Miss) – Indicates that the ray missed the scene or any geometry within the specified region of the scene.

[0121] visit (Visit) – Indicates the child volume that the ray will traverse.

[0122] abnormal (Exceptions) - includes various types of exception handlers (e.g., called for various error conditions).

[0123] In one embodiment, the ray tracing core 245 can be adapted to accelerate general computing operations that can be accelerated using computing techniques similar to ray intersection tests. A computing framework can be provided that enables shader programs to be compiled into low-level instructions and / or primitives that perform general computing operations via the ray tracing core. Exemplary computing problems that can benefit from computing operations performed on the ray tracing core 245 include calculations involving beam, wave, light or particle propagation in a coordinate space. Interactions associated with the propagation can be calculated relative to a geometry or mesh in a coordinate space. For example, calculations associated with the propagation of electromagnetic signals through an environment can be accelerated using instructions or primitives executed via a ray tracing core. Diffraction and reflection of signals by objects in the environment can be calculated as a direct ray tracing analogy.

[0124] The ray tracing core 245 can also be used to perform calculations that are not directly similar to ray tracing. For example, the ray tracing core 245 can be used to accelerate mesh projection, mesh refinement, and volume sampling calculations. General coordinate space calculations, such as nearest neighbor calculations, can also be performed. For example, a set of points near a given point can be found by defining a bounding box in the coordinate space around the point. The BVH and ray detection logic within the ray tracing core 245 can then be used to determine a set of point intersections within the bounding box. The intersection constitutes the origin and the nearest neighbor to the origin. The calculations performed using the ray tracing core 245 can be performed in parallel with the calculations performed on the graphics core 243 and the tensor core 244. The shader compiler can be configured to compile a compute shader or other general graphics processing program into a low-level primitive that can be parallelized across the graphics core 243, the tensor core 244, and the ray tracing core 245.

[0125] Figure 2D2 is a block diagram of a general purpose graphics processing unit (GPGPU) 270 according to an embodiment described herein, which GPGPU 270 can be configured as a graphics processor and / or a computing accelerator. GPGPU 270 can be interconnected with a host processor (e.g., one or more CPUs 246) and memories 271, 272 via one or more system and / or memory buses. In one embodiment, memory 271 is a system memory that can be shared with one or more CPUs 246, while memory 272 is a device memory dedicated to GPGPU 270. In one embodiment, components within GPGPU 270 and memory 272 can be mapped to memory addresses accessible by one or more CPUs 246. Access to memories 271 and 272 can be facilitated via a memory controller 268. In one embodiment, memory controller 268 includes an internal direct memory access (DMA) controller 269, or can include logic for performing operations that would otherwise be performed by a DMA controller.

[0126] GPGPU 270 includes a plurality of cache memories, including L2 cache 253, L1 cache 254, instruction cache 255, and shared memory 256, at least a portion of which may also be partitioned as cache memories. GPGPU 270 also includes a plurality of computing units 260A-260N, which represent similar Figure 2B Graphics cores 221A-221F and Figure 2CThe hierarchical abstraction level of the multi-core group 240A-240N of FIG. Each computing unit 260A-260N includes a set 261 of vector registers, a set 262 of scalar registers, a set 263 of vector logic units, and a set 264 of scalar logic units. The computing units 260A-260N may also include a local shared memory 265 and a program counter 266. The computing units 260A-260N may be coupled with a constant cache 267, which may be used to store constant data, which is data that will not change during the execution of a core program or a shader program executed on the GPGPU 270. In one embodiment, the constant cache 267 is a scalar data cache, and the cached data may be directly fetched into the scalar registers 262. During operation, one or more CPUs 246 may write commands to registers in the GPGPU 270, or to memory in the GPGPU 270 that has been mapped to an accessible address space. The command processor 257 can read commands from registers or memory and determine how to process those commands within the GPGPU 270. The thread dispatcher 258 can then be used to dispatch threads to the computing units 260A-260N to execute those commands. Each computing unit 260A-260N can execute threads independently of other computing units. In addition, each computing unit 260A-260N can be independently configured for conditional calculations and can conditionally output the results of the calculations to memory. When the submitted commands are completed, the command processor 257 can interrupt one or more CPUs 246.

[0127] Figure 3A-3C Block diagram illustrating additional graphics processor and computing accelerator architectures provided by embodiments described herein. Figure 3A-3C Those elements having the same reference numerals (or names) as elements of any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto.

[0128] Figure 3A 3 is a block diagram of a graphics processor 300, which may be a discrete graphics processing unit, or may be a graphics processor integrated with multiple processing cores or other semiconductor devices, such as, but not limited to, memory devices or network interfaces. In some embodiments, the graphics processor communicates via a memory-mapped I / O interface to registers on the graphics processor and using commands placed into processor memory. In some embodiments, the graphics processor 300 includes a memory interface 314 for accessing memory. The memory interface 314 may be an interface to local memory, one or more internal caches, one or more shared external caches, and / or system memory.

[0129] In some embodiments, the graphics processor 300 also includes a display controller 302 for driving display output data to a display device 318. The display controller 302 includes hardware for compositing one or more overlay planes and multiple layers of video or user interface elements for a display. The display device 318 can be an internal or external display device. In one embodiment, the display device 318 is a head-mounted display device, such as a virtual reality (VR) display device or an augmented reality (AR) display device. In some embodiments, the graphics processor 300 includes a video codec engine 306 for encoding media to one or more media coding formats, decoding media from one or more media coding formats, or transcoding media between one or more media coding formats, including but not limited to: Moving Picture Experts Group (MPEG) formats (such as MPEG-2), Advanced Video Coding (AVC) formats (such as H.264 / MPEG-4 AVC, H.265 / HEVC, Alliance for Open Media (AO Media) VP8, VP9), and Society of Motion Picture & Television Engineers (SMPTE) 421M / VC-1, and Joint Photographic Experts Group (JPEG) formats (such as JPEG and Motion JPEG (MJPEG) formats).

[0130] In some embodiments, graphics processor 300 includes a block image transfer (BLIT) engine for performing two-dimensional (2D) rasterizer operations, including, for example, bit boundary block transfers. However, in one embodiment, 2D graphics operations are performed using one or more components of graphics processing engine (GPE) 310. In some embodiments, GPE 310 is a compute engine for performing graphics operations, including three-dimensional (3D) graphics operations and media operations.

[0131] In some embodiments, GPE 310 includes a 3D pipeline 312 for performing 3D operations, such as rendering three-dimensional images and scenes using processing functions that act on 3D primitive shapes (e.g., rectangles, triangles, etc.). 3D pipeline 312 includes programmable and fixed-function elements that perform various tasks within elements and / or generated execution threads of 3D / media subsystem 315. Although 3D pipeline 312 can be used to perform media operations, embodiments of GPE 310 also include a media pipeline 316 that is specifically used to perform media operations, such as video post-processing and image enhancement.

[0132] In some embodiments, the media pipeline 316 includes fixed-function or programmable logic units for performing one or more specialized media operations, such as video decoding acceleration, video deinterlacing, and video encoding acceleration, instead of, or on behalf of the video codec engine 306. In some embodiments, the media pipeline 316 additionally includes a thread generation unit to generate threads for execution on the 3D / media subsystem 315. The generated threads perform calculations for media operations on one or more graphics cores included in the 3D / media subsystem 315.

[0133] In some embodiments, the 3D / media subsystem 315 includes logic for executing threads generated by the 3D pipeline 312 and the media pipeline 316. In one embodiment, the pipeline sends thread execution requests to the 3D / media subsystem 315, which includes thread dispatch logic for arbitrating and dispatching various requests for available thread execution resources. The execution resources include an array of graphics cores for processing 3D threads and media threads. In some embodiments, the 3D / media subsystem 315 includes one or more internal caches for thread instructions and data. In some embodiments, the subsystem also includes a shared memory for sharing data between threads and for storing output data, which includes registers and addressable memory.

[0134] Figure 3B A graphics processor 320 having a tiled architecture is shown in accordance with an embodiment described herein. In one embodiment, the graphics processor 320 includes a graphics processing engine cluster 322 having graphics engine slices 310A-310D. Figure 3A310D. Each graphics engine slice 310A-310D may be interconnected via a set 323A-323F of slice interconnects. Each graphics engine slice 310A-310D may also be connected to a memory module or memory device 326A-326D via a memory interconnect 325A-325D. The memory device 326A-326D may use any graphics memory technology. For example, the memory device 326A-326D may be a graphics double data rate (GDDR) memory. In one embodiment, the memory devices 326A-326D are HBM modules that may be on a die with their corresponding graphics engine slices 310A-310D. In one embodiment, the memory devices 326A-326D are stacked memory devices that may be stacked on top of their corresponding graphics engine slices 310A-310D. In one embodiment, each graphics engine slice 310A-310D and associated memory 326A-326D resides on a separate chiplet that is bonded to a base die or substrate, such as in Figure 11B-Figure 11D As described in further detail in .

[0135] Graphics processor 320 may be configured with a non-uniform memory access (NUMA) system in which memory devices 326A-326D are coupled to associated graphics engine slices 310A-310D. A given memory device may be accessed by a graphics engine slice rather than a slice to which it is directly connected. However, access latency to memory devices 326A-326D may be lowest when accessing a local slice. In one embodiment, a cache-consistent NUMA (ccNUMA) system is enabled that uses slice interconnects 323A-323F to enable communication between cache controllers within graphics engine slices 310A-310D to maintain a consistent memory image when more than one cache stores the same memory location.

[0136] The graphics processing engine cluster 322 may be connected to an on-chip or on-package fabric interconnect 324. In one embodiment, the fabric interconnect 324 includes a network processor, a network on chip (NoC), or other switch processor to enable the fabric interconnect 324 to function as a packet-switched fabric interconnect that exchanges data packets between components of the graphics processor 320. The fabric interconnect 324 may enable communication between the graphics engine slices 310A-310D and components such as the video codec engine 306 and one or more replica engines 304. The replica engines 304 may be used to move data out of the memory devices 326A-326D and memory external to the graphics processor 320 (e.g., system memory), move data into the memory devices 326A-326D and memory external to the graphics processor 320 (e.g., system memory), and move data between the memory devices 326A-326D and memory external to the graphics processor 320 (e.g., system memory). Fabric interconnect 324 may also be coupled to one or more of slice interconnects 323A-323F to facilitate or enhance interconnection between graphics engine slices 310A-310D. Fabric interconnect 324 may also be configured to interconnect multiple instances of graphics processor 320 (e.g., via host interface 328), thereby enabling slice-to-slice communication between graphics engine slices 310A-310D of multiple GPUs. In one embodiment, graphics engine slices 310A-310D of multiple GPUs may be presented to a host system as a single logical device.

[0137] The graphics processor 320 may optionally include a display controller 302 to enable connection to a display device 318. The graphics processor may also be configured as a graphics accelerator or a computing accelerator. In an accelerator configuration, the display controller 302 and the display device 318 may be omitted.

[0138] Graphics processor 320 may be connected to a host system via host interface 328. Host interface 328 may enable communication between graphics processor 320, system memory, and / or system components. Host interface 328 may be, for example, a PCI Express bus or another type of host system interface. For example, host interface 328 may be an NVLink or NVSwitch interface. Host interface 328 and fabric interconnect 324 may collaborate to enable multiple instances of graphics processor 320 to act as a single logical device. The collaboration between host interface 328 and fabric interconnect 324 may also enable individual graphics engine slices 310A-310D to be presented to the host system as different logical graphics devices.

[0139] Figure 3C FIG. 3 shows a computing accelerator 330 according to an embodiment described herein. The computing accelerator 330 may include Figure 3BThe computing engine cluster 332 may have an architectural similarity to the graphics processor 320 in the graphics processor 320, and is optimized for computing acceleration. The computing engine cluster 332 may include a set 340A-340D of computing engine slices, and the set 340A-340D of computing engine slices includes execution logic optimized for parallel or vector-based general computing operations. In some embodiments, the computing engine slices 340A-340D do not include fixed-function graphics processing logic, but in one embodiment, one or more of the computing engine slices 340A-340D may include logic for performing media acceleration. The computing engine slices 340A-340D may be connected to the memory 326A-326D via the memory interconnect 325A-325D. The memory 326A-326D and the memory interconnect 325A-325D may be similar technologies as in the graphics processor 320, or may be different technologies. The compute engine slices 340A-340D may also be interconnected via a set of tile interconnects 323A-323F, and may be connected to and / or interconnected by a fabric interconnect 324. Cross-tile communication may be facilitated via the fabric interconnect 324. The fabric interconnect 324 may also facilitate communication between the compute engine slices 340A-340D of multiple instances of a compute accelerator 330 (e.g., via a host interface 328). In one embodiment, the compute accelerator 330 includes a large L3 cache 336 that may be configured as a device-wide cache. The compute accelerator 330 may also communicate with the host computer 328 to communicate with the host computer 328. Figure 3B The graphics processor 320 in FIG. 1 is connected to a host processor and memory via a host interface 328 in a similar manner.

[0140] The computing accelerator 330 may also include an integrated network interface 342. In one embodiment, the network interface 342 includes a network processor and controller logic that enables the computing engine cluster 332 to communicate via a physical layer interconnect 344 without requiring data to pass through the memory of the host system. In one embodiment, one of the computing engine slices 340A-340D is replaced by a network processor logic, and data to be transmitted or received via the physical layer interconnect 344 can be directly transmitted to or received from the memory 326A-326D. Multiple instances of the computing accelerator 330 can be joined into a single logical device via the physical layer interconnect 344. Alternatively, the various computing engine slices 340A-340D can be presented as different network-accessible computing accelerator devices.

[0141] Graphics processing engine

[0142] Figure 4is a block diagram of a graphics processing engine 410 of a graphics processor according to some embodiments. In one embodiment, the graphics processing engine (GPE) 410 is Figure 3A A version of the GPE 310 shown in FIG. Figure 3B The graphics engine slices 310A-310D in FIG. Figure 4 Those elements having the same reference numerals (or names) as elements of any other figure herein can operate or function in any manner similar to that described elsewhere herein, but are not limited thereto. Figure 3A 410. The 3D pipeline 312 and the media pipeline 316 of the GPE 410. The media pipeline 316 is optional in some embodiments of the GPE 410 and may not be explicitly included within the GPE 410. For example and in at least one embodiment, separate media and / or image processors are coupled to the GPE 410.

[0143] In some embodiments, the GPE 410 is coupled to or includes a command streamer 403 that provides a command stream to the 3D pipeline 312 and / or the media pipeline 316. Alternatively or additionally, the command streamer 403 may be directly coupled to a unified return buffer 418. The unified return buffer 418 may be communicatively coupled to the graphics core cluster 414. In some embodiments, the command streamer 403 is coupled to a memory, which may be a system memory, or one or more of an internal cache memory and a shared cache memory. In some embodiments, the command streamer 403 receives commands from the memory and sends these commands to the 3D pipeline 312 and / or the media pipeline 316. These commands are instructions taken from a ring buffer that stores commands for the 3D pipeline 312 and the media pipeline 316. In one embodiment, the ring buffer may additionally include a batch command buffer that stores a batch of multiple commands. Commands for the 3D pipeline 312 may also include references to data stored in memory, such as, but not limited to, vertex data and geometry data for the 3D pipeline 312 and / or image data and memory objects for the media pipeline 316. The 3D pipeline 312 and the media pipeline 316 process commands and data by performing operations via logic within their respective pipelines or by dispatching one or more execution threads to the graphics core cluster 414. In one embodiment, the graphics core cluster 414 includes one or more graphics core blocks (e.g., graphics core block 415A, graphics core block 415B), each block including one or more graphics cores. Each graphics core includes a collection of graphics execution resources, including: general execution logic and graphics-specific execution logic for performing graphics operations and computational operations; and fixed-function texture processing logic and / or machine learning and artificial intelligence acceleration logic, such as matrix or AI acceleration logic.

[0144] In various embodiments, the 3D pipeline 312 may include fixed function and programmable logic for processing one or more shader programs, such as vertex shaders, geometry shaders, pixel shaders, fragment shaders, compute shaders, or other shaders and / or GPGPU programs, by processing instructions and dispatching execution threads to the graphics core cluster 414. The graphics core cluster 414 provides a unified execution resource block for use in processing these shader programs. The multi-function execution logic within the graphics core blocks 415A-415B of the graphics core cluster 414 includes support for various 3D API shader languages ​​and can execute multiple simultaneous execution threads associated with multiple shaders.

[0145] In some embodiments, graphics core cluster 414 includes execution logic for performing media functions such as video and / or image processing. In one embodiment, the graphics core includes general purpose logic that can be programmed to perform parallel general purpose computing operations in addition to performing graphics processing operations. The general purpose logic can be used with Figure 1 (one or more) processor cores 107 or Figure 2A The general logic within the cores 202A-202N in the MCU performs processing operations in parallel or in combination.

[0146] Output data generated by threads executing on graphics core cluster 414 may output data to memory in unified return buffer (URB) 418. URB 418 may store data for multiple threads. In some embodiments, URB 418 may be used to send data between different threads executing on graphics core cluster 414. In some embodiments, URB 418 may additionally be used for synchronization between threads on the graphics core array and fixed function logic within shared function logic 420.

[0147] In some embodiments, graphics core cluster 414 is scalable such that the cluster includes a variable number of graphics cores, each having a variable number of graphics cores based on the target power and performance level of GPE 410. In one embodiment, execution resources are dynamically scalable such that execution resources can be enabled or disabled as needed.

[0148] The graphics core cluster 414 is coupled to shared function logic 420, which includes a plurality of resources shared between the graphics cores in the graphics core array. The shared functions within the shared function logic 420 are hardware logic units that provide specialized supplemental functions to the graphics core cluster 414. In various embodiments, the shared function logic 420 may include, but is not limited to, sampler logic 421, math logic 422, and inter-thread communication (ITC) logic 423. Additionally, some embodiments implement one or more caches 425 within the shared function logic 420. The shared function logic 420 may implement Figure 2B The additional fixed function logic 238 performs the same or similar functions.

[0149] Shared functionality is implemented at least in cases where demand for a given specialized functionality is insufficient to be included in graphics core cluster 414. Instead, a single instantiation of the specialized functionality is implemented as an independent entity in shared functionality logic 420 and shared between execution resources within graphics core cluster 414. The exact set of functions shared between graphics core clusters 414 and included within graphics core cluster 414 varies from embodiment to embodiment. In some embodiments, specific shared functionality within shared functionality logic 420 that is widely used by graphics core cluster 414 may be included within shared functionality logic 416 within graphics core cluster 414. In various embodiments, shared functionality logic 416 within graphics core cluster 414 may include some or all of the logic within shared functionality logic 420. In one embodiment, all logic elements within shared functionality logic 420 may be replicated within shared functionality logic 416 of graphics core cluster 414. In one embodiment, shared functionality logic 420 is excluded in favor of shared functionality logic 416 within graphics core cluster 414.

[0150] Graphics processing resources

[0151] Figures 5A-5C Execution logic including an array of processing elements employed in a graphics processor is illustrated according to embodiments described herein. Figure 5A Illustrated is a graphics core cluster according to an embodiment. Figure 5B Illustrated is a vector engine of a graphics core according to an embodiment. Figure 5C Illustrated is a matrix engine of a graphics core according to an embodiment. Figures 5A-5C Elements in the same figure as elements in any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto. For example, Figures 5A-5C The components can be Figure 2B The graphics processor core block 219 and / or Figure 4 In one embodiment, Figures 5A-5C The components have Figure 2A Graphics processor 208, Figure 2C GPU 239 or Figure 2D The equivalent components of the GPGPU 270 have similar functions.

[0152] like Figure 5A As shown, in one embodiment, the graphics core cluster 414 includes a graphics core block 415, which may be Figure 4Graphics core block 415 may include any number of graphics cores (e.g., graphics core 515A, graphics core 515B through graphics core 515N). Multiple instances of graphics core block 415 may be included. In one embodiment, the components of graphics cores 515A-515N have the same Figure 2B 221F of the graphics core 221A-221F. In such an embodiment, the graphics cores 515A-515N each include circuitry including, but not limited to, vector engines 502A-502N, matrix engines 503A-503N, memory load / store units 504A-504N, instruction caches 505A-505N, data caches / shared local memories 506A-506N, ray tracing units 508A-508N, and samplers 510A-510N. The circuitry of the graphics cores 515A-515N may additionally include fixed function logic 512A-512N. The number of vector engines 502A-502N and matrix engines 503A-503N within a designed graphics core 515A-515N may vary based on the workload, performance, and power targets for the design.

[0153] With reference to graphics core 515A, vector engine 502A and matrix engine 503A can be configured to perform parallel computing operations on data in various integer and floating point data formats based on instructions associated with shader programs. Each vector engine 502A and matrix engine 503A can act as a programmable general-purpose computing unit that can execute multiple simultaneous hardware threads while processing multiple data elements in parallel for each thread. Vector engine 502A and matrix engine 503A support processing with variable width vectors of various SIMD widths (including but not limited to SIMD8, SIMD16 and SIMD32). Input data elements can be stored in registers as compact data types, and vector engine 502A and matrix engine 503A can process various elements based on the data size of the elements. For example, when operating on a 256-bit wide vector, the 256 bits of the vector are stored in registers and the vector is processed as four separate 64-bit packed data elements (quad-word (QW) size data elements), eight separate 32-bit packed data elements (double-word (DW) size data elements), sixteen separate 16-bit packed data elements (word (W) size data elements), or thirty-two separate 8-bit data elements (byte (B) size data elements). However, different vector widths and register sizes are possible. In one embodiment, the vector engine 502A and the matrix engine 503A can also be configured to perform SIMT operations on warps or thread groups of various sizes (e.g., 8, 16 or 32 threads).

[0154] Continuing with the graphics core 515A, the memory load / store unit 504A services memory access requests issued by the vector engine 502A, the matrix engine 503A, and / or other components of the graphics core 515A that have access to memory. The memory access request can be processed by the memory load / store unit 504A to load or store the requested data to or from the cache or memory into a register file associated with the vector engine 502A and / or the matrix engine 503A. The memory load / store unit 504A can also perform prefetch operations. In one embodiment, the memory load / store unit 504A is configured to provide SIMT scatter / gather prefetch or block prefetch for data stored in the memory 610 from memory local to other slices or from system memory via the slice interconnect 608. Prefetching can be performed on a specific L1 cache (e.g., data cache / shared local memory 506A), L2 cache 604, or L3 cache 606. In one embodiment, a prefetch to L3 cache 606 automatically causes the data to be stored in L2 cache 604 .

[0155] Instruction cache 505A stores instructions to be executed by graphics core 515A. In one embodiment, graphics core 515A also includes instruction acquisition and pre-fetch circuits that acquire or pre-fetch instructions into instruction cache 505A. Graphics core 515A also includes instruction decoding logic to decode instructions within instruction cache 505A. Data cache / shared local memory 506A can be configured as a data cache managed by a cache controller that implements a cache replacement strategy and / or configured as a shared memory that is explicitly managed. Ray tracing unit 508A includes circuits for accelerating ray tracing operations. Sampler 510A provides texture sampling for 3D operations and media sampling for media operations. Fixed function logic 512A includes fixed function circuits shared between various instances of vector engine 502A and matrix engine 503A. Graphics cores 515B-515N can operate in a manner similar to graphics core 515A.

[0156] The functions of instruction caches 505A-505N, data cache / shared local memory 506A-506N, ray tracing units 508A-508N, samplers 510A-510N, and fixed function logic 512A-512N correspond to equivalent functions in the graphics processor architecture described herein. For example, instruction caches 505A-505N may be implemented in a manner similar to Figure 2D The data cache / shared local memory 506A-506N, the ray tracing units 508A-508N and the samplers 510A-510N can be operated in a manner similar to Figure 2B The fixed function logic 512A-512N may include the cache / SLM 228A-228F, the ray tracing unit 227A-227F and the sampler 226A-226F. Figure 2B In one embodiment, ray tracing units 508A-508N include components for performing the operations performed by Figure 2C The ray tracing core 245 is a circuit for performing ray tracing acceleration operations.

[0157] like Figure 5BAs shown, in one embodiment, the vector engine 502 includes an instruction fetch unit 537, a general register file array (GRF) 524, an architectural register file array (ARF) 526, a thread arbiter 522, an issue unit 530, a branch unit 532, a set of SIMD floating point units (FPUs) 534, and a set of integer SIMD ALUs 535 in one embodiment. The GRF 524 and ARF 526 include a set of general register files and architectural register files associated with each hardware thread that can be active in the vector engine 502. In one embodiment, the per-thread architectural state is maintained in the ARF 526, and data used during thread execution is stored in the GRF 524. The execution state of each thread, including the instruction pointer for each thread, can be maintained in thread-specific registers in the ARF 526.

[0158] In one embodiment, the vector engine 502 has an architecture that is a combination of Simultaneous Multi-Threading (SMT) and fine-grained Interleaved Multi-Threading (IMT). The architecture has a modular configuration that can be fine-tuned at design time based on the target number of simultaneous threads and the number of registers per graphics core, where graphics core resources are divided across logic for executing multiple simultaneous threads. The number of logical threads that can be executed by the vector engine 502 is not limited to the number of hardware threads, and multiple logical threads can be assigned to each hardware thread.

[0159] In one embodiment, vector engine 502 can issue multiple instructions in coordination, and these instructions can be different instructions respectively.Thread arbiter 522 can dispatch instructions to one of the following items for execution: send unit 530, branch unit 532 or (one or more) SIMD FPU 534. Each execution thread can access 128 general registers in GRF 524, wherein each register can store 32 bytes that can be accessed as a variable width vector with 32-bit data elements. In one embodiment, each thread has access to 4 kilobytes in GRF 524, but the embodiment is not limited thereto, and more or less register resources can be provided in other embodiments. In one embodiment, vector engine 502 is partitioned into seven hardware threads that can independently perform calculation operations, but the number of threads of each vector engine 502 can also be different according to the embodiment. For example, in one embodiment, support up to 16 hardware threads. In the embodiment where seven threads can access 4 kilobytes, GRF 524 can store a total of 28 kilobytes. With 16 threads accessing 4 kilobytes, a total of 64 kilobytes can be stored by GRF 524. Flexible addressing modes may permit multiple registers to be addressed together, creating effectively wider registers or representing strided rectangular block data structures.

[0160] In one embodiment, memory operations, sampler operations, and other longer latency system communications are dispatched via "send" instructions executed through message passing send unit 530. In one embodiment, branch instructions are dispatched to a dedicated branch unit 532 to facilitate SIMD divergence and eventual convergence.

[0161] In one embodiment, the vector engine 502 includes one or more SIMD floating point units (FPUs) 534 for performing floating point operations. In one embodiment, the (one or more) FPUs 534 also support integer calculations. In one embodiment, the (one or more) FPUs 534 can perform up to a number M of 32-bit floating point (or integer) operations, or perform up to 2M 16-bit integer or 16-bit floating point operations. In one embodiment, at least one of the (one or more) FPUs provides extended math capabilities that support high throughput transcendental math functions and double-precision 64-bit floating points. In some embodiments, a set 535 of 8-bit integer SIMD ALUs also exists and can be specifically optimized to perform operations associated with machine learning calculations. In one embodiment, the SIMD ALUs are replaced by an additional set of SIMD FPUs 534, which can be configured to perform integer and floating point operations. In one embodiment, the SIMD FPUs 534 and SIMD ALUs 535 can be configured to execute SIMT programs. In one embodiment, combined SIMD+SIMT operations are supported. In one embodiment, an array of multiple instances of the vector engine 502 can be instantiated in a graphics core. For scalability, product architects can choose the exact number of vector engines per graphics core grouping. In one embodiment, vector engine 502 can execute instructions across multiple execution lanes. In further embodiments, each thread executed on vector engine 502 is executed on a different lane.

[0162] like Figure 5CAs shown, in one embodiment, the matrix engine 503 includes an array of processing elements, which are configured to perform tensor operations, including vector / matrix and matrix / matrix operations, such as but not limited to matrix multiplication and / or dot product operations. The matrix engine 503 is configured with M rows and N columns of processing elements (552AA-552MN), which include multipliers and adder circuits organized in a pipelined manner. In one embodiment, the processing elements 552AA-552MN form a physical pipeline stage of a systolic array of N width and M depth, which can be used to perform vector / matrix or matrix / matrix operations in a data parallel manner, including matrix multiplication, fused multiplication-addition, dot product or other general matrix-matrix multiplication (GEMM) operations. In one embodiment, the matrix engine 503 supports 16-bit floating point operations, as well as 8-bit, 4-bit, 2-bit and binary integer operations. The matrix engine 503 can also be configured to accelerate specific machine learning operations. In such an embodiment, the matrix engine 503 may be configured with support for the bfloat (brain floating point) 16-bit floating point format or the tensor float 32-bit floating point format (TF32), which have a different number of mantissa and exponent bits relative to the Institute of Electrical and Electronics Engineers (IEEE) 754 format.

[0163] In one embodiment, during each cycle, each stage can add the result of the operation performed at the stage to the output of the previous stage. In other embodiments, after the calculation cycle set, the data movement pattern between the processing elements 552AA-552MN can change based on the instruction or macro operation being executed. For example, in one embodiment, the partial sum loopback is enabled, and the processing element can instead add the output of the current cycle to the output generated in the previous cycle. In one embodiment, the last stage of the systolic array can be configured with a loopback to the initial stage of the systolic array. In such an embodiment, the number of physical pipeline stages can be decoupled from the number of logical pipeline stages supported by the matrix engine 503. For example, in the case where the processing elements 552AA-552MN are configured as a systolic array of M physical stages, the loopback from stage M to the initial pipeline stage can enable the processing elements 552AA-552MN to operate as a systolic array of logical pipeline stages such as 2M, 3M, 4M, etc.

[0164] In one embodiment, the matrix engine 503 includes memories 541A-541N, 542A-542M to store input data in the form of row and column data of the input matrix. The memories 542A-542M can be configured to store the row elements (A0-Am) of the first input matrix, and the memories 541A-541N can be configured to store the column elements (B0-Bn) of the second input matrix. The row and column elements are provided to the processing elements 552AA-552MN as input for processing. In one embodiment, before the row and column elements of the input matrix are provided to the memories 541A-541N, 542A-542M, these elements can be stored in the systolic register file 540 within the matrix engine 503. In one embodiment, the systolic register file 540 is excluded, and the memories 541A-541N, 542A-542M are removed from the registers in the associated vector engine (e.g., Figure 5B 524 of the vector engine 502) or other memory of the graphics core including the matrix engine 503 (e.g., Figure 5A The results generated by the processing elements 552AA-552MN are then output to output buffers and / or written to register files (e.g., systolic register file 540, GRF 524, data cache / shared local memory 506A-506N) for further processing by other functional units of the graphics processor or output to memory.

[0165] In some embodiments, the matrix engine 503 is configured with support for input sparsity, wherein the multiplication operation for the sparse area of ​​the input data can be bypassed by skipping the multiplication operation with zero-valued operands. In one embodiment, the processing element 552AA-552MN is configured to skip the execution of certain operations with zero-valued inputs. In one embodiment, the sparsity in the input matrix can be detected, and the operation with known zero output value can be bypassed before being submitted to the processing element 552AA-552MN. Loading the zero-valued operand into the processing element can be bypassed, and the processing element 552AA-552MN can be configured to perform multiplication on non-zero-valued input elements. The matrix engine 503 can also be configured with support for output sparsity, so that the operation with the result predetermined to be zero is bypassed. For input sparsity and / or output sparsity, in one embodiment, metadata is provided to the processing element 552AA-552MN to indicate which processing elements and / or data channels will be active during the cycle for the processing cycle.

[0166] In one embodiment, matrix engine 503 includes hardware that enables operation on sparse data, and this sparse data has the compression representation of the sparse matrix storing non-zero values ​​and the metadata of the position of the non-zero value in the matrix.Exemplary compression representation includes but is not limited to compressed tensor representation, such as compressed sparse row (CSR), compressed sparse column (CSC), compressed sparse fiber (CSF) representation.Support for compressed representation enables operation to input in compressed tensor format, without decompressing or decoding compressed representation.In such embodiment, operation can be performed only on non-zero input value, and the obtained non-zero output value can be mapped to output matrix.In certain embodiments, hardware support is also provided for the machine-specific lossless data compression format used when transmitting data in hardware or across system bus.For sparse input data, this data can be retained in compressed format, and matrix engine 503 can use the compression metadata of compressed data, so that operation can be performed only on non-zero value, or block that can bypass zero data input is carried out multiplication operation.

[0167] In various embodiments, the input data may be provided by the programmer in a compressed tensor representation, or the codec may compress the input data into a compressed tensor representation or another sparse data encoding. In addition to support for compressed tensor representations, streaming compression of sparse input data may be performed before the data is provided to the processing elements 552AA-552MN. In one embodiment, compression is performed on data written to a cache memory associated with the graphics core cluster 414, wherein the compression is performed using an encoding supported by the matrix engine 503. In one embodiment, the matrix engine 503 includes support for inputs with structured sparsity, in which a predetermined level or pattern of sparsity is applied to the input data. The data may be compressed to a known compression ratio, wherein the processing elements 552AA-552MN process the compressed data according to metadata associated with the compressed data.

[0168] Figure 6 FIG. 6 is a diagram of a slice 600 of a multi-slice processor according to an embodiment. In one embodiment, slice 600 represents Figure 3B Graphics engine chips 310A-310D or Figure 3C Slice 600 of a multi-slice graphics processor includes an array of graphics core clusters (e.g., graphics core cluster 414A, graphics core cluster 414B through graphics core cluster 414N), each of which has an array of graphics cores 515A-515N. Slice 600 also includes a global dispatcher 602 for dispatching threads to processing resources of slice 600.

[0169] Slice 600 may include or be coupled with L3 cache 606 and memory 610. In various embodiments, L3 cache 606 may be excluded or slice 600 may include additional levels of cache, such as an L4 cache. In one embodiment, each instance of slice 600 in a multi-slice graphics processor has an associated memory 610, such as in Figure 3B and Figure 3C In one embodiment, the multi-chip processor can be configured as a multi-chip module, where the L3 cache 606 and / or memory 610 reside on a chiplet that is separate from the graphics core clusters 414A-414N. In this context, a chiplet is an at least partially packaged integrated circuit that includes different logic units that can be assembled with other chiplets into a larger package. For example, the L3 cache 606 can be included in a dedicated cache chiplet, or can reside on the same chiplet as the graphics core clusters 414A-414N. In one embodiment, the L3 cache 606 can be included in an active base die or an active interposer, such as Fig. 11C As shown in the figure.

[0170] Memory structure 603 enables communication between graphics core clusters 414A-414N, L3 cache 606, and memory 610. L2 cache 604 is coupled to memory structure 603 and may be configured to cache transactions executed via memory structure 603. Slice interconnect 608 enables communication with other slices on the graphics processor and may be Figure 3B and 3C 604. In an embodiment where L3 cache 606 is excluded from slice 600, L2 cache 604 may be configured as a combined L2 / L3 cache. In a specific implementation, memory structure 603 may be configured to route data to L3 cache 606 or a memory controller associated with memory 610 based on the presence or absence of L3 cache 606. L3 cache 606 may be configured as a per-tile cache dedicated to the processing resources of slice 600, or may be a partition of a GPU-wide L3 cache.

[0171] Figure 7700 is a block diagram illustrating a graphics processor instruction format 700 according to some embodiments. In one or more embodiments, the graphics processor core supports an instruction set having instructions in multiple formats. Solid line boxes illustrate components that are typically included in the graphics core instructions, while dashed lines include components that are optional or included only in a subset of the instructions. In some embodiments, the graphics processor instruction format 700 described and illustrated are macroinstructions because they are instructions supplied to the graphics core, as opposed to micro-operations that result from instruction decoding that is performed once the instruction is processed. Therefore, a single instruction can cause the hardware to perform multiple micro-operations.

[0172] In some embodiments, the graphics processor natively supports instructions in the 128-bit instruction format 710. Based on the selected instructions, instruction options, and the number of operands, the 64-bit compact instruction format 730 can be used for some instructions. The native 128-bit instruction format 710 provides access to all instruction options, while some options and operations are limited in the 64-bit format 730. The native instructions available in the 64-bit format 730 vary from embodiment to embodiment. In some embodiments, the instructions are partially compressed using a set of index values ​​in the index field 713. The graphics core hardware references a set of compression tables based on the index values ​​and uses the compression table output to reconstruct the native instructions of the 128-bit instruction format 710. Other sizes and formats of instructions can be used.

[0173] For each format, the instruction opcode 712 defines the operation to be performed by the graphics core. The graphics core executes each instruction in parallel across multiple data elements of each operand. For example, in response to an addition instruction, the graphics core performs a synchronous addition operation across each color channel representing a texture element or a picture element. By default, the graphics core executes each instruction across all data channels of the operand. In some embodiments, the instruction control field 714 enables control of certain execution options, such as channel selection (e.g., predication) and data channel order (e.g., mixing). For instructions in the 128-bit instruction format 710, the execution size field 716 limits the number of data channels that will be executed in parallel. In some embodiments, the execution size field 716 is not available for the 64-bit compact instruction format 730.

[0174] Some graphics core instructions have up to three operands, including two source operands src0 720, src1 722, and one destination operand 718. In some embodiments, the graphics core supports dual destination instructions, where one of the dual destinations is implicit. Data manipulation instructions may have a third source operand (e.g., SRC2 724), where the instruction opcode 712 determines the number of source operands. The last source operand of an instruction may be an immediate (e.g., hard-coded) value passed with the instruction.

[0175] In some embodiments, the 128-bit instruction format 710 includes an access / addressing mode field 726 that specifies, for example, whether direct register addressing mode or indirect register addressing mode is used. When direct register addressing mode is used, the register addresses of one or more operands are provided directly by bits in the instruction.

[0176] In some embodiments, the 128-bit instruction format 710 includes an access / addressing mode field 726, which specifies the addressing mode and / or access mode of the instruction. In one embodiment, the access mode is used to define the data access alignment for the instruction. Some embodiments support access modes including 16-byte aligned access modes and 1-byte aligned access modes, wherein the byte alignment of the access mode determines the access alignment of the instruction operand. For example, when in the first mode, the instruction may use byte-aligned addressing for source operands and destination operands, and when in the second mode, the instruction may use 16-byte aligned addressing for all source operands and destination operands.

[0177] In one embodiment, the addressing mode portion of the access / addressing mode field 726 determines whether the instruction uses direct addressing or indirect addressing. When direct register addressing mode is used, the bits in the instruction directly provide the register address of one or more operands. When indirect register addressing mode is used, the register address of one or more operands can be calculated based on the address register value and the address immediate field in the instruction.

[0178] In some embodiments, instructions are grouped based on the opcode 712 bit field to simplify opcode decoding 740. For an 8-bit opcode, bits 4, 5, and 6 allow the graphics core to determine the type of opcode. The exact opcode grouping shown is only an example. In some embodiments, the move and logic opcode group 742 includes data movement and logic instructions (e.g., move (mov), compare (cmp)). In some embodiments, the move and logic group 742 shares five most significant bits (MSB), where the move (mov) instruction takes the form of 0000xxxxb and the logic instruction takes the form of 0001xxxxb. The flow control instruction group 744 (e.g., call (call), jump (jmp)) includes instructions in the form of 0010xxxxb (e.g., 0x7). The miscellaneous instruction group 746 includes a mixture of instructions, including synchronization instructions (e.g., wait (wait), send (send)) in the form of 0011xxxxb (e.g., 0x30). The parallel math instruction group 748 includes component-by-component arithmetic instructions (e.g., add, multiply (mul)) of the form 0100xxxxb (e.g., 0x40). The parallel math group 748 performs arithmetic operations in parallel across data channels. The vector math group 750 includes arithmetic instructions (e.g., dp4) of the form 0101xxxxb (e.g., 0x50). The vector math group performs arithmetic on vector operands, such as dot product calculations. In one embodiment, the illustrated opcode decode 740 can be used to determine which portion of the graphics core will be used to execute the decoded instructions. For example, some instructions may be designated as systolic instructions to be executed by a systolic array. Other instructions, such as ray tracing instructions (not shown) may be routed to a ray tracing core or ray tracing logic within a slice or partition of the execution logic.

[0179] Graphics Pipeline

[0180] Figure 8 is a block diagram of another embodiment of a graphics processor 800 . Figure 8 Those elements having the same reference numerals (or names) as elements of any other figure herein may operate or function in any manner similar to that described elsewhere herein, but are not limited thereto.

[0181] In some embodiments, the graphics processor 800 includes a geometry pipeline 820, a media pipeline 830, a display engine 840, a thread execution logic 850, and a rendering output pipeline 870. In some embodiments, the graphics processor 800 is a graphics processor within a multi-core processing system that includes one or more general-purpose processing cores. The graphics processor is controlled by register writes to one or more control registers (not shown) or via commands issued to the graphics processor 800 through the ring interconnect 802. In some embodiments, the ring interconnect 802 couples the graphics processor 800 to other processing components, such as other graphics processors or general-purpose processors. Commands from the ring interconnect 802 are interpreted by a command streamer 803, which supplies instructions to various components of the geometry pipeline 820 or the media pipeline 830.

[0182] In some embodiments, command streamer 803 directs the operation of vertex fetcher 805, which reads vertex data from memory and executes vertex processing commands provided by command streamer 803. In some embodiments, vertex fetcher 805 provides vertex data to vertex shader 807, which performs coordinate space transformation and lighting operations on each vertex. In some embodiments, vertex fetcher 805 and vertex shader 807 execute vertex processing instructions by dispatching execution threads to graphics cores 852A-852B via thread dispatcher 831.

[0183] In some embodiments, the graphics cores 852A-852B are arrays of vector processors with instruction sets for performing graphics operations and media operations. In some embodiments, the graphics cores 852A-852B have an attached L1 cache 851 that is dedicated to each array or shared between arrays. The cache can be configured as a data cache, an instruction cache, or partitioned into a single cache containing data and instructions in different partitions.

[0184] In some embodiments, the geometry pipeline 820 includes a tessellation component for performing hardware accelerated tessellation of 3D objects. In some embodiments, the programmable shell shader 811 configures the tessellation operation. The programmable domain shader 817 provides back-end evaluation of the tessellation output. The tessellation 813 operates under the direction of the shell shader 811 and includes dedicated logic for generating a detailed set of geometric objects based on a coarse geometric model that is provided as input to the geometry pipeline 820. In some embodiments, if tessellation is not used, the tessellation component (e.g., the shell shader 811, the tessellation 813, and the domain shader 817) can be bypassed. The tessellation component can operate based on data received from the vertex shader 807.

[0185] In some embodiments, the complete geometric object may be processed by the geometry shader 819 via one or more threads dispatched to the graphics cores 852A-852B, or may proceed directly to the clipper 829. In some embodiments, the geometry shader operates on the entire geometric object rather than on vertices or vertex patches as in previous stages of the graphics pipeline. If tessellation is disabled, the geometry shader 819 receives input from the vertex shader 807. In some embodiments, the geometry shader 819 is programmable by a geometry shader program to perform geometry tessellation when the tessellation unit is disabled.

[0186] Before rasterization, the clipper 829 processes the vertex data. The clipper 829 can be a fixed function clipper or a programmable clipper with clipping and geometry shader functions. In some embodiments, the rasterizer and depth test component 873 in the rendering output pipeline 870 dispatches a pixel shader to convert the geometric object into a pixel-by-pixel representation. In some embodiments, the pixel shader logic is included in the thread execution logic 850. In some embodiments, the application can bypass the rasterizer and depth test component 873 and access the unrasterized vertex data via the outflow unit 823.

[0187] The graphics processor 800 has an interconnect bus, interconnect structure, or some other interconnect mechanism that allows data and messages to be passed among the main components of the processor. In some embodiments, the graphics core 852A-852B and associated logic units (e.g., L1 cache 851, sampler 854, texture cache 858, etc.) are interconnected via data port 856 to perform memory access and communicate with the rendering output pipeline components of the processor. In some embodiments, the sampler 854, cache 851, 858 and graphics core 852A-852B each have a separate memory access path. In one embodiment, the texture cache 858 can also be configured as a sampler cache.

[0188] In some embodiments, the render output pipeline 870 includes a rasterizer and depth test component 873, which converts vertex-based objects into associated pixel-based representations. In some embodiments, the rasterizer logic includes a window / masker unit for performing fixed-function triangle and line rasterization. An associated rendering buffer 878 and depth buffer 879 are also available in some embodiments. The pixel operation component 877 performs pixel-based operations on data, but in some instances, pixel operations associated with 2D operations (e.g., using mixed bit block image transfer) are performed by the 2D engine 841, or replaced by the display controller 843 using an overlay display plane when displayed. In some embodiments, a shared L3 cache 875 can be used for all graphics components, allowing data to be shared without using main system memory.

[0189] In some embodiments, the media pipeline 830 includes a media engine 837 and a video front end 834. In some embodiments, the video front end 834 receives pipeline commands from the command streamer 803. In some embodiments, the media pipeline 830 includes a separate command streamer. In some embodiments, the video front end 834 processes the media commands before sending them to the media engine 837. In some embodiments, the media engine 837 includes a thread generation function for generating threads for dispatching to the thread execution logic 850 via the thread dispatcher 831.

[0190] In some embodiments, the graphics processor 800 includes a display engine 840. In some embodiments, the display engine 840 is external to the processor 800 and is coupled to the graphics processor via the ring interconnect 802, or some other interconnect bus or structure. In some embodiments, the display engine 840 includes a 2D engine 841 and a display controller 843. In some embodiments, the display engine 840 includes dedicated logic that can operate independently of the 3D pipeline. In some embodiments, the display controller 843 is coupled to a display device (not shown), which can be a system integrated display device (such as in a laptop) or an external display device attached via a display device connector.

[0191] In some embodiments, the geometry pipeline 820 and the media pipeline 830 may be configured to perform operations based on multiple graphics and media programming interfaces, and are not dedicated to any one application programming interface (API). In some embodiments, the driver software of the graphics processor converts API calls dedicated to a specific graphics or media library into commands that can be processed by the graphics processor. In some embodiments, support is provided for the Open Graphics Library (OpenGL), the Open Computing Language (OpenCL) and / or the Vulkan graphics and computing APIs all from the Khronos Group. In some embodiments, support may also be provided for the Direct3D library from Microsoft. In some embodiments, a combination of these libraries may be supported. Support may also be provided for the OpenSource Computer Vision Library (OpenCV). If a mapping from the pipeline of a future API to the pipeline of a graphics processor can be performed, future APIs with compatible 3D pipelines will also be supported.

[0192] Graphics pipeline programming

[0193] Fig.9A is a block diagram illustrating a graphics processor command format 900 that may be used to program a graphics processing pipeline in accordance with some embodiments. Fig. 9B is a block diagram illustrating a graphics processor command sequence 910 according to an embodiment. Fig.9A The solid-line boxes in illustrate components that are generally included in the graphics commands, while the dashed lines include components that are optional or included only in a subset of the graphics commands. Fig.9A An exemplary graphics processor command format 900 includes a data field for identifying a client 902, a command operation code (opcode) 904, and a data field for the command 906. A subopcode 905 and a command size 908 are also included in some commands.

[0194] In some embodiments, client 902 specifies the client unit of processing command data of graphics device. In some embodiments, graphics processor command parser checks the client field of each command to adjust the further processing of command and route command data to appropriate client unit. In some embodiments, graphics processor client unit includes memory interface unit, rendering unit, 2D unit, 3D unit, and media unit. Each client unit has a corresponding processing pipeline for processing command. Once command is received by client unit, client unit reads opcode 904 and sub-opcode 905 (if present) to determine the operation to be performed. Client unit uses information in data field 906 to execute command. For some commands, explicit command size 908 is expected to specify the size of command. In some embodiments, command parser automatically determines the size of at least some commands in command based on command opcode. In some embodiments, command is aligned via multiples of double word. Other command formats can be used.

[0195] Fig. 9B The flowchart in 910 illustrates an exemplary graphics processor command sequence 910. In some embodiments, software or firmware of a data processing system featuring an embodiment of a graphics processor uses a version of the command sequence shown to establish, execute, and terminate a set of graphics operations. The sample command sequence is shown and described for exemplary purposes only, as the embodiments are not limited to these particular commands or command sequences. Moreover, the commands may be issued as batches of commands in a command sequence so that the graphics processor will process the command sequence in an at least partially simultaneous manner.

[0196] In some embodiments, the graphics processor command sequence 910 may begin with a pipeline dump clear command 912 to cause any active graphics pipeline to complete the pipeline's currently pending commands. In some embodiments, the 3D pipeline 922 and the media pipeline 924 do not operate concurrently. The pipeline dump clear is performed to cause the active graphics pipeline to complete any pending commands. In response to the pipeline dump clear, the command parser for the graphics processor will suspend command processing until the active drawing engine completes the pending operation and the associated read cache is invalidated. Optionally, any data marked as "dirty" in the rendering cache can be dumped to memory. In some embodiments, the pipeline dump clear command 912 can be used for pipeline synchronization, or before placing the graphics processor in a low power state.

[0197] In some embodiments, when a command sequence requires the graphics processor to explicitly switch between pipelines, a pipeline select command 913 is used. In some embodiments, a pipeline select command 913 is only required once in an execution context before issuing pipeline commands unless the context will issue commands for both pipelines. In some embodiments, a pipeline flush command 912 is required immediately before a pipeline switch via a pipeline select command 913.

[0198] In some embodiments, pipeline control commands 914 configure the graphics pipeline for operation and are used to program 3D pipeline 922 and media pipeline 924. In some embodiments, pipeline control commands 914 configure the pipeline state of the active pipeline. In one embodiment, pipeline control commands 914 are used for pipeline synchronization and are used to clear data from one or more cache memories within the active pipeline before processing a batch of commands.

[0199] In some embodiments, commands associated with return buffer state 916 are used to configure a set of return buffers for a corresponding pipeline to write data. Some pipeline operations require allocating, selecting, or configuring one or more return buffers into which the operation writes intermediate data during processing. In some embodiments, the graphics processor also uses one or more return buffers to store output data and perform cross-thread communication. In some embodiments, return buffer state 916 includes selecting the size and number of return buffers to be used for a set of pipeline operations.

[0200] The remaining commands in the command sequence differ based on the active pipeline for operation.Based on pipeline decision 920 , the command sequence is tailored for either the 3D pipeline 922 starting at 3D pipeline state 930 , or the media pipeline 924 starting at media pipeline state 940 .

[0201] The commands for configuring the 3D pipeline state 930 include 3D state setting commands for vertex buffer state, vertex element state, constant color state, depth buffer state, and other state variables that will be configured before processing 3D primitive commands. The values ​​of these commands are determined at least in part based on the specific 3D API in use. In some embodiments, the 3D pipeline state 930 commands can also selectively disable or bypass certain pipeline elements if those elements will not be used.

[0202] In some embodiments, 3D primitive 932 commands are used to submit 3D primitives to be processed by the 3D pipeline. The commands and associated parameters passed to the graphics processor via the 3D primitive 932 commands are forwarded to the vertex acquisition function in the graphics pipeline. The vertex acquisition function uses the 3D primitive 932 command data to generate multiple vertex data structures. The vertex data structure is stored in one or more return buffers. In some embodiments, 3D primitive 932 commands are used to perform vertex operations on 3D primitives via vertex shaders. In order to process vertex shaders, the 3D pipeline 922 dispatches shader programs to the graphics core.

[0203] In some embodiments, the 3D pipeline 922 is triggered via an execute 934 command or event. In some embodiments, a register write triggers the command execution. In some embodiments, the execution is triggered via a "go" or "kick" command in the command sequence. In one embodiment, the command execution is triggered using a pipeline synchronization command to dump and clear the command sequence through the graphics pipeline. The 3D pipeline will perform geometry processing for 3D primitives. Once the operation is completed, the resulting geometric objects are rasterized and the pixel engine shades the resulting pixels. For those operations, additional commands for controlling pixel shading and pixel backend operations may also be included.

[0204] In some embodiments, when performing media operations, the graphics processor command sequence 910 follows the media pipeline 924 path. Generally, the specific purpose and manner of programming for the media pipeline 924 depends on the media or computing operation to be performed. During media decoding, specific media decoding operations can be transferred to the media pipeline. In some embodiments, the media pipeline can also be bypassed, and the resources provided by one or more general processing cores can be used to perform media decoding in whole or in part. In one embodiment, the media pipeline also includes elements for general purpose graphics processor unit (GPGPU) operations, wherein the graphics processor is used to perform SIMD vector operations using compute shader programs, which are not explicitly related to the rendering of graphics primitives.

[0205] In some embodiments, the media pipeline 924 is configured in a similar manner to the 3D pipeline 922. A set of commands for configuring the media pipeline state 940 is dispatched or placed into a command queue, before the media object commands 942. In some embodiments, the commands for the media pipeline state 940 include data for configuring the media pipeline elements that will be used to process the media objects. This includes data for configuring the video decoding and video encoding logic within the media pipeline, such as encoding or decoding formats. In some embodiments, the commands for the media pipeline state 940 also support the use of one or more pointers to "indirect" state elements that contain batches of state settings.

[0206] In some embodiments, media object commands 942 supply pointers to media objects for processing by the media pipeline. The media object includes a memory buffer that contains video data to be processed. In some embodiments, all media pipeline states must be valid before issuing media object commands 942. Once the pipeline state is configured and the media object commands 942 are queued, the media pipeline 924 is triggered via an execution command 944 or an equivalent execution event (e.g., a register write). The output from the media pipeline 924 can then be post-processed by operations provided by the 3D pipeline 922 or the media pipeline 924. In some embodiments, GPGPU operations are configured and executed in a manner similar to media operations.

[0207] Graphics software architecture

[0208] Fig.10 An exemplary graphics software architecture for data processing system 1000 according to some embodiments is illustrated. In some embodiments, the software architecture includes 3D graphics application 1010, operating system 1020, and at least one processor 1030. In some embodiments, processor 1030 includes graphics processor 1032 and one or more general purpose processor cores 1034. Graphics application 1010 and operating system 1020 are each executed in system memory 1050 of the data processing system.

[0209] In some embodiments, the 3D graphics application 1010 includes one or more shader programs, which include shader instructions 1012. The shader language instructions can be in a high-level shader language, such as the High-Level Shader Language (HLSL) of Direct3D, the OpenGL Shader Language (GLSL), etc. The application also includes executable instructions 1014 in a machine language suitable for execution by the general-purpose processor core 1034. The application also includes graphics objects 1016 defined by vertex data.

[0210] In some embodiments, operating system 1020 is from Microsoft Corporation Operating system, exclusive UNIX-like operating system, or open source UNIX-like operating system using a variant of the Linux kernel. Operating system 1020 may support graphics API 1022, such as Direct3D API, OpenGL API, or Vulkan API. When Direct3D API is in use, operating system 1020 uses front-end shader compiler 1024 to compile any shader instruction 1012 using HLSL into a lower-level shader language. Compilation may be just-in-time (JIT) compilation, or application executable shader precompilation. In some embodiments, during the compilation of 3D graphics application 1010, high-level shaders are compiled into low-level shaders. In some embodiments, shader instructions 1012 are provided in an intermediate form, such as a certain version of the Standard Portable Intermediate Representation (SPIR) used by Vulkan API.

[0211] In some embodiments, the user mode graphics driver 1026 includes a backend shader compiler 1027 for converting shader instructions 1012 into hardware-specific representations. When the OpenGL API is in use, the shader instructions 1012 in the GLSL high-level language are passed to the user mode graphics driver 1026 for compilation. In some embodiments, the user mode graphics driver 1026 uses the operating system kernel mode function 1028 to communicate with the kernel mode graphics driver 1029. In some embodiments, the kernel mode graphics driver 1029 communicates with the graphics processor 1032 to dispatch commands and instructions.

[0212] IP core implementation

[0213] One or more aspects of at least one embodiment may be implemented by representative code stored on a machine-readable medium that represents and / or defines logic within an integrated circuit (such as a processor). For example, a machine-readable medium may include instructions representing various logic within a processor. When read by a machine, the instructions may cause the machine to manufacture logic for performing the techniques described herein. Such representations (referred to as "IP cores") are reusable units of logic for an integrated circuit that may be stored on a tangible, machine-readable medium as a hardware model describing the structure of the integrated circuit. The hardware model may be supplied to each consumer or manufacturing facility that loads the hardware model on a manufacturing machine that manufactures the integrated circuit. The integrated circuit may be manufactured so that the circuit performs the operations described in association with any of the embodiments described herein.

[0214] Fig.11A 1 is a block diagram illustrating an IP core development system 1100 according to an embodiment, which can be used to manufacture integrated circuits to perform operations. The IP core development system 1100 can be used to generate modular, reusable designs that can be incorporated into larger designs or used to build entire integrated circuits (e.g., SOC integrated circuits). The design facility 1130 can generate a software simulation 1110 of the IP core design using a high-level programming language (e.g., C / C++). The software simulation 1110 can be used to design, test, and verify the behavior of the IP core using a simulation model 1112. The simulation model 1112 can include functional simulation, behavioral simulation, and / or timing simulation. A register transfer level (RTL) design 1115 can then be created or synthesized from the simulation model 1112. The RTL design 1115 is an abstraction of the behavior of an integrated circuit (including associated logic executed using the modeled digital signals) that models the flow of digital signals between hardware registers. In addition to the RTL design 1115, a lower level design at the logic level or transistor level can also be created, designed, or synthesized. Thus, the specific details of the initial design and simulation may vary.

[0215] The RTL design 1115 or an equivalent may be further synthesized by the design facility into a hardware model 1120, which may be in a hardware description language (HDL) or some other representation of physical design data. The HDL may be further simulated or tested to verify the IP core design. The IP core design may be stored using a non-volatile memory 1140 (e.g., a hard disk, flash memory, or any non-volatile storage medium) for delivery to a third-party manufacturing facility 1165. Alternatively, the IP core design may be transmitted via a wired connection 1150 or a wireless connection 1160 (e.g., via the Internet). The manufacturing facility 1165 may then manufacture an integrated circuit based at least in part on the IP core design. The manufactured integrated circuit may be configured to perform operations according to at least one embodiment described herein.

[0216] Fig. 11B A cross-sectional side view of an integrated circuit package assembly 1170 according to some embodiments described herein is illustrated. The integrated circuit package assembly 1170 illustrates an implementation of one or more processors or accelerator devices as described herein. The package assembly 1170 includes a plurality of hardware logic units 1172, 1174 connected to a substrate 1180. The logic 1172, 1174 may be implemented at least in part in configurable logic or fixed function logic hardware, and may include one or more portions of any of the processor cores, graphics processors, or other accelerator devices described herein (one or more). Each logic unit 1172, 1174 may be implemented within a semiconductor die and coupled to the substrate 1180 via an interconnect structure 1173. The interconnect structure 1173 may be configured to route electrical signals between the logic 1172, 1174 and the substrate 1180, and may include interconnects such as, but not limited to, bumps or pillars. In some embodiments, the interconnect structure 1173 can be configured to route electrical signals, such as, for example, input / output (I / O) signals and / or power or ground signals associated with the operation of the logic 1172, 1174. In some embodiments, the substrate 1180 is a laminate substrate based on epoxy resin. In other embodiments, the package substrate 1180 may include other suitable types of substrates. The package assembly 1170 can be connected to other electrical devices via the package interconnect 1183. The package interconnect 1183 can be coupled to the surface of the substrate 1180 to route electrical signals to other electrical devices, such as a motherboard, other chipsets, or multi-chip modules.

[0217] In some embodiments, logic units 1172, 1174 are electrically coupled to a bridge 1182 that is configured to route electrical signals between logic 1172 and logic 1174. Bridge 1182 may be a dense interconnect structure that provides routing for electrical signals. Bridge 1182 may include a bridge substrate composed of glass or a suitable semiconductor material. Circuit features may be formed on the bridge substrate to provide a chip-to-chip connection between logic 1172 and logic 1174.

[0218] Although two logic cells 1172, 1174 and bridge 1182 are illustrated, the embodiments described herein may include more or fewer logic cells on one or more dies. The one or more dies may be connected by zero or more bridges, as bridge 1182 may be excluded when the logic is included on a single die. Alternatively, multiple dies or logic cells may be connected by one or more bridges. Additionally, multiple logic cells, dies, and bridges may be connected together in other possible configurations, including three-dimensional configurations.

[0219] Fig. 11C The diagram shows a package assembly 1190 of hardware logic chiplets of multiple units connected to a substrate 1180. Graphics processing units, parallel processors, and / or computing accelerators as described herein may be composed of various silicon chiplets manufactured separately. Various collections of chiplets with different IP core logics may be assembled into a single device. Additionally, active interposer technology may be used to integrate chiplets into a base die or base chiplet. The concepts described herein enable interconnection and communication between different forms of IP within a GPU. IP cores may be manufactured using different process technologies and assembled during manufacturing, which avoids the complexity of aggregating multiple IPs into the same manufacturing process, especially for large SoCs with several styles of IP. Allowing the use of multiple process technologies improves time to market and provides a cost-effective method to create multiple product SKUs. In addition, the deaggregated IP is more suitable for being independently power-gated, and components that are not used on a given workload can be turned off, thereby reducing overall power consumption.

[0220] In various embodiments, the package assembly 1190 may include components and chiplets interconnected by structures 1185 and / or one or more bridges 1187. The chiplets within the package assembly 1190 may have a 2.5D arrangement using chip-on-wafer-on-substrate stacking, where multiple dies are stacked side-by-side on a silicon interposer 1189 that couples the chiplets to the substrate 1180. The substrate 1180 includes electrical connections to the package interconnects 1183. In one embodiment, the silicon interposer 1189 is a passive interposer that includes through-silicon vias (TSVs) to electrically couple the chiplets within the package assembly 1190 to the substrate 1180. In one embodiment, the silicon interposer 1189 is an active interposer that includes embedded logic in addition to the TSVs. In such an embodiment, the chiplets within the package assembly 1190 are arranged on top of the active interposer 1189 using 3D face-to-face die stacking. In addition to the interconnect fabric 1185 and silicon bridge 1187, the active mid-level layer 1189 may also include hardware logic 1191 for I / O, cache memory 1192, and other hardware logic 1193. The fabric 1185 enables communication between the various logic chiplets 1172, 1174 and the logic 1191, 1193 within the active mid-level layer 1189. The fabric 1185 may be a NoC interconnect or another form of packet switching fabric that exchanges data packets between components of the package assembly. For complex assemblies, the fabric 1185 may be a dedicated chiplet that enables communication between the various hardware logic of the package assembly 1190.

[0221] A bridge structure 1187 within the active mid-level 1189 may be used to facilitate point-to-point interconnection between, for example, a logic or I / O chiplet 1174 and a memory chiplet 1175. In some implementations, the bridge structure 1187 may also be embedded within the substrate 1180. The hardware logic chiplet may include a dedicated hardware logic chiplet 1172, a logic or I / O chiplet 1174, and / or a memory chiplet 1175. The hardware logic chiplet 1172 and the logic or I / O chiplet 1174 may be implemented at least in part in configurable logic or fixed-function logic hardware and may include one or more portions of any of the processor core(s), graphics processor(s), parallel processor, or other accelerator device(s) described herein. The memory chiplet 1175 may be a DRAM (e.g., GDDR, HBM) memory or a cache (SRAM) memory. The cache memory 1192 within the active interposer 1189 (or substrate 1180 ) may function as a global cache for the package assembly 1190 , as part of a distributed global cache, or as a dedicated cache for the structure 1185 .

[0222] Each chiplet may be fabricated as a separate semiconductor die and coupled to a base die embedded within or coupled to the substrate 1180. The coupling to the substrate 1180 may be performed via an interconnect structure 1173. The interconnect structure 1173 may be configured to route electrical signals between the various chiplets and logic within the substrate 1180. The interconnect structure 1173 may include interconnects such as, but not limited to, bumps or pillars. In some embodiments, the interconnect structure 1173 may be configured to route electrical signals such as, for example, input / output (I / O) signals and / or power signals or ground signals associated with the operation of the logic chiplets, I / O chiplets, and memory chiplets. In one embodiment, an additional interconnect structure couples the active interposer 1189 to the substrate 1180.

[0223] In some embodiments, substrate 1180 is an epoxy-based laminate substrate. In other embodiments, substrate 1180 may include other suitable types of substrates. Package assembly 1190 may be connected to other electrical devices via package interconnect 1183. Package interconnect 1183 may be coupled to the surface of substrate 1180 to route electrical signals to other electrical devices, such as a motherboard, other chipsets, or multi-chip modules.

[0224] In some embodiments, the logic or I / O chiplet 1174 and the memory chiplet 1175 may be electrically coupled via a bridge 1187 configured to route electrical signals between the logic or I / O chiplet 1174 and the memory chiplet 1175. The bridge 1187 may be a dense interconnect structure that provides routing for electrical signals. The bridge 1187 may include a bridge substrate composed of glass or a suitable semiconductor material. Circuit features may be formed on the bridge substrate to provide a chip-to-chip connection between the logic or I / O chiplet 1174 and the memory chiplet 1175. The bridge 1187 may also be referred to as a silicon bridge or an interconnect bridge. For example, in some embodiments, the bridge 1187 is an embedded multi-die interconnect bridge (Embedded Multi-die Interconnect Bridge, EMIB). In some embodiments, the bridge 1187 may be just a direct connection from one chiplet to another chiplet.

[0225] Fig.11DA package assembly 1194 including interchangeable chiplets 1195 is illustrated according to an embodiment. Interchangeable chiplets 1195 can be assembled into standardized sockets on one or more base chiplets 1196, 1198. The base chiplets 1196, 1198 can be coupled via a bridge interconnect 1197, which can be similar to other bridge interconnects described herein and can be, for example, EMIB. Memory chiplets can also be connected to logic or I / O chiplets via a bridge interconnect. The I / O and logic chiplets can communicate via an interconnect structure. The base chiplets can each support one or more sockets in a standardized format for logic or I / O or memory / cache.

[0226] In one embodiment, the SRAM and power delivery circuits may be fabricated into one or more of the base chiplets 1196, 1198, which may be fabricated using a different process technology relative to the interchangeable chiplets 1195, which are stacked on top of the base chiplets. For example, the base chiplets 1196, 1198 may be fabricated using a larger process technology while the interchangeable chiplets may be fabricated using a smaller process technology. One or more of the interchangeable chiplets 1195 may be memory (e.g., DRAM) chiplets. Different memory densities may be selected for the package assembly 1194 based on power and / or performance for a product using the package assembly 1194. Additionally, logic chiplets having different numbers of types of functional units may be selected at assembly time based on power and / or performance for the product. Additionally, chiplets containing IP logic cores having different types may be inserted into the interchangeable chiplet sockets, thereby enabling hybrid memory designs that may mix and match IP blocks of different technologies.

[0227] Exemplary System-on-Chip Integrated Circuit

[0228] Figure 12-14 An exemplary integrated circuit and associated graphics processor that can be manufactured using one or more IP cores according to various embodiments described herein are illustrated. In addition to what is illustrated, other logic and circuits may also be included, including additional graphics processors / cores, peripheral interface controllers, or general-purpose processor cores.

[0229] Fig.121 is a block diagram illustrating an exemplary system-on-chip integrated circuit 1200 that can be manufactured using one or more IP cores according to an embodiment. The exemplary integrated circuit 1200 includes one or more application processors 1205 (e.g., CPUs), at least one graphics processor 1210, and may additionally include an image processor 1215 and / or a video processor 1220, any of which may be modular IP cores from the same design facility or multiple different design facilities. The integrated circuit 1200 includes peripheral or bus logic, including a USB controller 1225, a UART controller 1230, a SPI / SDIO controller 1235, and an I2S / I2C controller 1240. In addition, the integrated circuit may include a display device 1245, which is coupled to one or more of a high-definition multimedia interface (HDMI) controller 1250 and a mobile industry processor interface (MIPI) display interface 1255. Storage may be provided by a flash subsystem 1260 (including flash memory and a flash controller). A memory interface may be provided via a memory controller 1265 to gain access to SDRAM or SRAM memory devices. Some integrated circuits additionally include an embedded security engine 1270 .

[0230] Figure 13-14 is a block diagram illustrating an exemplary graphics processor for use within a SoC according to embodiments described herein. Fig.13 An exemplary graphics processor 1310 of a system-on-chip integrated circuit that may be fabricated using one or more IP cores is illustrated in accordance with an embodiment. Fig.14 An additional exemplary graphics processor 1340 is illustrated that may be fabricated using one or more IP cores of a system-on-chip integrated circuit in accordance with an embodiment. Fig.13 Graphics processor 1310 is an example of a low-power graphics processor core. Fig.14 The graphics processor 1340 of FIG. 1 is an example of a higher performance graphics processor core. Each of the graphics processor 1310 and the graphics processor 1340 may be Fig.12 A variant of graphics processor 1210.

[0231] like Fig.13As shown in , the graphics processor 1310 includes a vertex processor 1305 and one or more fragment processors 1315A-1315N (e.g., 1315A, 1315B, 1315C, 1315D to 1315N-1 and 1315N). The graphics processor 1310 can execute different shader programs via separate logic, so that the vertex processor 1305 is optimized to perform operations for vertex shader programs, while one or more fragment processors 1315A-1315N perform fragment (e.g., pixel) shading operations for fragment or pixel shader programs. The vertex processor 1305 performs the vertex processing stage of the 3D graphics pipeline and generates primitive data and vertex data. (One or more) fragment processors 1315A-1315N use the primitive data and vertex data generated by the vertex processor 1305 to generate a frame buffer that is displayed on a display device. In one embodiment, the fragment processor(s) 1315A-1315N are optimized to execute fragment shader programs as provided in the OpenGL API, which can be used to perform similar operations as pixel shader programs as provided in the Direct 3D API.

[0232] The graphics processor 1310 additionally includes one or more memory management units (MMUs) 1320A-1320B, (one or more) caches 1325A-1325B, and (one or more) circuit interconnects 1330A-1330B. The one or more MMUs 1320A-1320B provide virtual to physical address mappings for the graphics processor 1310 (including for the vertex processor 1305 and / or (one or more) fragment processors 1315A-1315N), which may reference vertex data or image / texture data stored in memory in addition to vertex data or image / texture data stored in the one or more caches 1325A-1325B. In one embodiment, the one or more MMUs 1320A-1320B may be synchronized with other MMUs within the system so that each processor 1205-1220 may participate in a shared or unified virtual memory system, including other MMUs within the system. Fig.12 One or more MMUs associated with one or more application processors 1205, image processor 1215, and / or video processor 1220. According to an embodiment, one or more circuit interconnects 1330A-1330B enable graphics processor 1310 to interface with other IP cores within the SoC via an internal bus of the SoC or via a direct connection.

[0233] like Fig.14 As shown in FIG. 1 , the graphics processor 1340 includes Fig.13One or more MMUs 1320A-1320B, (one or more) caches 1325A-1325B, and (one or more) circuit interconnects 1330A-1330B of the graphics processor 1310. The graphics processor 1340 includes one or more shader cores 1355A-1355N (e.g., 1355A, 1355B, 1355C, 1355D, 1355E, 1355F to 1355N-1 and 1355N), which provide a unified shader core architecture in which a single core or type or core can execute all types of programmable shader code, including shader program code for implementing vertex shaders, fragment shaders, and / or compute shaders. The unified shader core architecture can also be configured to execute directly compiled high-level GPGPU programs (e.g., CUDA). The exact number of shader cores present can vary depending on the embodiment and implementation. Additionally, the graphics processor 1340 includes an inter-core task manager 1345 that acts as a thread dispatcher for dispatching execution threads to one or more shader cores 1355A-1355N and a tiling unit 1358 for accelerating tiling operations for tile-based rendering, in which rendering operations for a scene are subdivided in image space, for example to exploit local spatial coherence within a scene or to optimize the use of internal caches.

[0234] Ray tracing using machine learning

[0235] As mentioned above, ray tracing is a graphics processing technique in which light transport is simulated through physically based rendering. One of the key operations of ray tracing is the processing of visibility queries, which requires traversal and intersection testing of nodes in a bounding volume hierarchy (BVH).

[0236] Ray tracing and path tracing based techniques compute images by tracing rays and paths through each pixel and using random sampling to compute advanced effects such as shadows, glossiness, indirect lighting, etc. Using only a few samples is fast but produces noisy images, while using many samples produces high quality images but is prohibitively expensive.

[0237] Machine learning includes any circuit, program code, or combination thereof that is capable of incrementally improving the performance of a specified task or rendering incrementally more accurate predictions or decisions. Some machine learning engines can perform these tasks or render these predictions / decisions without being explicitly programmed to perform the task or render the predictions / decisions. There are a variety of machine learning techniques, including (but not limited to) supervised and semi-supervised learning, unsupervised learning, and reinforcement learning.

[0238] Over the past few years, a breakthrough solution to ray / path tracing for real-time use has come in the form of "denoising" - the process of using image processing techniques to produce high-quality, filtered / denoised images from noisy, low sample count inputs. The most effective denoising techniques rely on machine learning techniques, where a machine learning engine learns what a noisy image might look like if more samples had been utilized to compute it. In one particular implementation, the machine learning is performed by a convolutional neural network (CNN); however, the underlying principles of the invention are not limited to CNN implementations. In this implementation, training data is generated using low sample count inputs and ground-truth. The CNN is trained to predict converging pixels based on a neighborhood of noisy pixel inputs surrounding the pixel under consideration.

[0239] While not perfect, this AI-based denoising technique has proven to be surprisingly effective. However, it is important to note that good training data is required, as the network may otherwise predict incorrect results. For example, if an animation film studio trained a denoising CNN on past films with scenes on land, and then tried to use the trained CNN to denoise frames from a new film set on water, the denoising operation would perform suboptimally.

[0240] To address this problem, learning data can be dynamically collected while rendering, and a machine learning engine (such as a CNN) can be continuously trained based on the data currently being run, thereby continuously improving the machine learning engine for the task at hand. Therefore, the training phase can still be performed before runtime, but the machine learning weights continue to be adjusted as needed during runtime. Thus, the high cost of computing the reference data required for training is avoided by limiting the generation of learning data to a sub-region of the image for each frame or every N frames. In particular, a noisy input of the frame is generated to denoise the entire frame using the current network. In addition, as described below, small areas of reference pixels are generated and used for continuous training.

[0241] Although CNN implementations are described herein, any form of machine learning engine may be used, including but not limited to systems that perform supervised learning (e.g., building a mathematical model of a set of data containing inputs and desired outputs), unsupervised learning (e.g., which evaluates input data for certain types of structures), and / or a combination of supervised and unsupervised learning.

[0242] Existing denoising implementations operate in a training phase and a run phase. During the training phase, a network topology is defined that receives an area of ​​NxN pixels with various pixel-by-pixel data channels and generates the final pixel color, such as pixel color, depth, normal, normal deviation, primitive ID, and reflectivity. A set of "representative" training data is generated using a frame's worth of low sample count inputs and reference to the "expected" pixel colors calculated using very high sample counts. The network is trained for these inputs, thereby generating a set of "ideal" weights for the network. In these implementations, reference data is used to train the weights of the network to most closely match the output of the network to the desired result.

[0243] At runtime, the given, pre-computed ideal network weights are loaded, and the network is initialized. For each frame, a low sample count image of the denoised input is generated (i.e., the same image as used for training). For each frame, a given neighborhood of pixel input is run through the network to predict the "denoised" pixel color, generating a denoised frame.

[0244] Ray Tracing Architecture In one implementation, a graphics processor includes circuitry and / or program code for performing real-time ray tracing. A collection of dedicated ray tracing cores may be included in a graphics processor to perform various ray tracing operations described herein, including ray traversal and / or ray intersection operations. In addition to ray tracing cores, multiple collections of graphics processing cores for performing programmable shading operations and multiple collections of tensor cores for performing matrix operations on tensor data may also be included. Fig.15 An exemplary portion of such a graphics processing unit (GPU) 1505 is illustrated, which includes a collection of dedicated graphics processing resources arranged as a multi-core group 1500A-1500N. Graphics processing unit (GPU) 1505 can be a variation of graphics processor 300, GPGPU 1340, and / or any other graphics processor described herein. Therefore, the disclosure of any feature of the graphics processor also discloses the corresponding combination with GPU 1505, but is not limited to this. In addition, Fig.15 Elements with the same or similar names as elements of any other figures herein describe the same elements as in the other figures, may operate or function in a similar manner as in the other figures, may include the same components, and may link other entities such as those described elsewhere herein, but are not limited thereto. Although details of only a single multi-core group 1500A are provided, it will be understood that other multi-core groups 1500B-1500N may be equipped with the same or similar sets of graphics processing resources.

[0245] As illustrated, multi-core group 1500A may include a set 1530 of graphics cores, a set 1540 of tensor cores, and a set 1550 of ray tracing cores. Scheduler / dispatcher 1510 schedules and dispatches graphics threads for execution on the respective cores 1530, 1540, 1550. A set 1520 of register files stores operand values ​​used by cores 1530, 1540, 1550 when executing graphics threads. These register files may include, for example, integer registers for storing integer values, floating point registers for storing floating point values, vector registers for storing packed data elements (integer and / or floating point data elements), and slice registers for storing tensor / matrix values. Slice registers may be implemented as a combined set of vector registers.

[0246] One or more first level (L1) caches and texture units 1560 store graphics data locally within each multi-core group 1500A, such as texture data, vertex data, pixel data, ray data, bounding volume data, etc. A second level (L2) cache 1580, shared by all multi-core groups 1500A-1500N or a subset of multi-core groups 1500A-1500N, stores graphics data and / or instructions for multiple concurrent graphics threads. As illustrated, the L2 cache 1580 may be shared across multiple multi-core groups 1500A-1500N. One or more memory controllers 1570 couple the GPU 1505 to a memory 1598, which may be system memory (e.g., DRAM) and / or local graphics memory (e.g., GDDR6 memory).

[0247] Input / output (IO) circuitry 1595 couples GPU 1505 to one or more I / O devices 1595, such as a digital signal processor (DSP), a network controller, or a user input device. On-chip interconnects may be used to couple I / O devices 1590 to GPU 1505 and memory 1598. One or more IO memory management units (IOMMUs) 1570 of IO circuitry 1595 directly couple I / O devices 1590 to system memory 1598. IOMMUs 1570 may manage page tables for mapping virtual addresses to multiple sets of physical addresses in system memory 1598. In addition, IO devices 1590, CPU(s) 1599, and GPU(s) 1505 may share the same virtual address space.

[0248] IOMMU 1570 may also support virtualization. In this case, IOMMU 1570 may manage a first set of page tables for mapping guest / graphics virtual addresses to guest / graphics physical addresses and a second set of page tables for mapping guest / graphics physical addresses to system / host physical addresses (e.g., within system memory 1598). The base address of each of the first set of page tables and the second set of page tables may be stored in a control register and swapped out upon context switch (e.g., so that the new context is provided with access to the relevant set of page tables). Although not described in detail in the prior art, the IOMMU 1570 may be used to map guest / graphics virtual addresses to guest / graphics physical addresses. Fig.15 , but each of the cores 1530, 1540, 1550 and / or multi-core groups 1500A-1500N may include a translation lookaside buffer (TLB) for caching guest virtual to guest physical translations, guest physical to host physical translations, and guest virtual to host physical translations.

[0249] The CPU 1599, GPU 1505, and IO device 1590 may be integrated on a single semiconductor chip and / or chip package. The illustrated memory 1598 may be integrated on the same chip, or may be coupled to a memory controller 1570 via an off-chip interface. In one implementation, the memory 1598 includes GDDR6 memory that shares the same virtual address space as other physical system-level memories, but the underlying principles of the invention are not limited to this particular implementation.

[0250] In one embodiment, the tensor core 1540 may include multiple execution units specifically designed to perform matrix operations, which are basic computational operations for performing deep learning operations. For example, synchronized matrix multiplication operations may be used for neural network training and inference. The tensor core 1540 may perform matrix processing using a variety of operand precisions, including single-precision floating point (e.g., 32 bits), half-precision floating point (e.g., 16 bits), integer words (16 bits), bytes (8 bits), and half bytes (4 bits). The neural network implementation may also extract features of each rendered scene, potentially combining details from multiple frames to construct a high-quality final image.

[0251] In a deep learning implementation, parallel matrix multiplication work can be scheduled for execution on the tensor core 1540. The training of neural networks in particular requires a large number of matrix dot product operations. To handle the inner product formulation of the N×N×N matrix multiplication, the tensor core 1540 may include at least N dot product processing elements. Before the matrix multiplication begins, a complete matrix is ​​loaded into the slice register, and for each of the N cycles, at least one column of the second matrix is ​​loaded. For each cycle, there are N dot products that are processed.

[0252] Depending on the specific implementation, matrix elements can be stored in different precisions, including 16-bit words, 8-bit bytes (e.g., INT8), and 4-bit nibbles (e.g., INT4). Different precision modes can be specified for the tensor cores 1540 to ensure that the most efficient precision is used for different workloads (e.g., such as inference workloads, which can tolerate quantization to bytes and to nibbles).

[0253] The ray tracing core 1550 can be used to accelerate ray tracing operations for both real-time ray tracing implementations and non-real-time ray tracing implementations. Specifically, the ray tracing core 1550 may include a ray traversal / intersection circuit for performing ray traversal using a bounding volume hierarchy (BVH) and identifying intersections between rays and primitives enclosed within the BVH. The ray tracing core 1550 may also include circuits for performing depth testing and culling (e.g., using a Z buffer or similar arrangement). In one implementation, the ray tracing core 1550 performs traversal operations and intersection operations in coordination with the image denoising techniques described herein, at least a portion of which may be performed on the tensor core 1540. For example, the tensor core 1540 may implement a deep learning neural network to perform denoising on frames generated by the ray tracing core 1550. However, (one or more) CPUs 1599, graphics cores 1530, and / or ray tracing cores 1550 may also implement all or part of the denoising and / or deep learning algorithms.

[0254] In addition, as described above, a distributed approach to noise reduction can be employed in which GPU 1505 is in a computing device coupled to other computing devices via a network or high-speed interconnect. The interconnected computing devices can additionally share neural network learning / training data to improve the speed at which the entire system learns to perform noise reduction for different types of image frames and / or different graphics applications.

[0255] The ray tracing core 1550 can handle all BVH traversals and ray-primitive intersections, thereby preventing the graphics core 1530 from being overloaded with thousands of instructions for each ray. Each ray tracing core 1550 can include a first set of specialized circuits for performing bounding box tests (e.g., for traversal operations) and a second set of specialized circuits for performing ray-triangle intersection tests (e.g., intersecting rays that have been traversed). Thus, the multi-core group 1500A can simply initiate ray detection, and the ray tracing core 1550 independently performs ray traversals and intersections and returns hit data (e.g., hits, no hits, multiple hits, etc.) to the thread context. When the ray tracing core 245 performs traversal and intersection operations, the other cores 1530, 1540 can be freed up to perform other graphics or computational work.

[0256] Each ray tracing core 1550 may include a traversal unit for performing BVH test operations and an intersection unit for performing ray-primitive intersection tests. The intersection unit may then generate a "hit", "no hit", or "multiple hits" response, which it provides to the appropriate thread. During traversal and intersection operations, execution resources of other cores (e.g., graphics core 1530 and tensor core 1540) may be freed up to perform other forms of graphics work.

[0257] A hybrid rasterization / ray tracing approach may also be used in which the work is distributed between graphics core 1530 and ray tracing core 1550 .

[0258] The ray tracing core 1550 (and / or other cores 1530, 1540) may include hardware support for ray tracing instruction sets such as Microsoft's DirectX Ray Tracing (DXR), which includes the DispatchRays command; and ray generation shaders, nearest hit shaders, any hit shaders, and miss shaders, which enable the assignment of a unique set of shaders and textures to each object. Another ray tracing platform that may be supported by the ray tracing core 1550, graphics core 1530, and tensor core 1540 is Vulkan 1.1.85. However, it is noted that the underlying principles of the invention are not limited to any particular ray tracing ISA.

[0259] In general, each core 1550, 1540, 1530 may support a ray tracing instruction set including instructions / functions for: ray generation, nearest hit, any hit, ray-primitive intersection, per-primitive and hierarchy bounding box construction, misses, visits, and exceptions. More specifically, ray tracing instructions may be included for performing the following functions:

[0260] Light Generation (Ray Generation) - Ray generation instructions can be executed for each pixel, sample, or other user-defined work distribution.

[0261] Recent Hits (Closest Hit) - A closest hit command can be executed to locate the closest intersection of a ray and a primitive within the scene. Any hit (Any Hit) – The Any Hit instruction identifies multiple intersections between rays and primitives within the scene, potentially identifying a new closest intersection point.

[0262] intersect (Intersection)——The intersection command performs a ray-primitive intersection test and outputs the result.

[0263] Per-primitive Bounding box Construction - This instruction builds a bounding box around a given primitive or group of primitives (e.g., when building a new BVH or other acceleration data structure).

[0264] miss (Miss) – Indicates that the ray missed the scene or any geometry within the specified region of the scene.

[0265] visit (Visit) – Indicates the descendant volumes that the ray will traverse.

[0266] abnormal (Exceptions) - includes various types of exception handlers (e.g., called for various error conditions).

[0267] Lossy and Lossless Packet Compression in Distributed Ray Tracing Systems Ray tracing operations can be distributed across multiple compute nodes coupled together via a network. For example, Fig.16 The illustrated ray tracing cluster 1600 includes a plurality of ray tracing nodes 1610-1613 performing ray tracing operations in parallel, potentially combining the results on one of the nodes. In the illustrated architecture, the ray tracing nodes 1610-1613 are communicatively coupled to a client-side ray tracing application 1630 via a gateway.

[0268] One of the difficulties of a distributed architecture is the large amount of packetized data that must be transmitted between each of the ray tracing nodes 1610-1613. Both lossless and lossy compression techniques can be used to reduce the data transmitted between the ray tracing nodes 1610-1613.

[0269] To achieve lossless compression, instead of sending packets filled with the results of certain types of operations, data or commands are sent that allow the receiving node to reconstruct the results. For example, randomly sampled area lights and ambient occlusion (AO) operations do not necessarily require direction. Therefore, the transmitting node can simply send a random seed, which is then used by the receiving node to perform random sampling. For example, if the scene is distributed across nodes 1610-1612, in order to sample light 1 at points p1-p3, only the light ID and origin need to be sent to nodes 1610-1612. Each of the nodes can then randomly sample the light independently. The random seed can be generated by the receiving node. Similarly, for the primary ray hit point, ambient occlusion (AO) and soft shadow sampling can be calculated on nodes 1610-1612 without waiting for the original point for consecutive frames. In addition, if it is known that a group of light rays will go to the same point light source, an instruction identifying the light source can be sent to the receiving node, and the receiving node will apply the light source to the group of light rays. As another example, if there are N ambient occlusion rays emitted from a single point, a command may be sent to generate N samples from that point.

[0270] Various additional techniques may be applied to lossy compression. For example, a quantization factor may be employed to quantize all coordinate values ​​associated with BVHs, primitives, and rays. In addition, 32-bit floating point values ​​for data such as BVH nodes and primitives may be converted to 8-bit integer values. In an exemplary implementation, the boundaries of the ray groupings are stored with full precision, but the individual ray points P1-P3 are transmitted as index offsets to the boundaries. Similarly, multiple local coordinate systems may be generated that use 8-bit integer values ​​as local coordinates. The origin position of each of these local coordinate systems may be encoded using full precision (e.g., 32-bit floating point) values, thereby effectively connecting the global coordinate system and the local coordinate system.

[0271] The following is an example of lossless compression. An example of the ray data format used internally by a ray tracing program is as follows:

[0272] struct Ray

[0273] {

[0274] uint32 pixId;

[0275] uint32 materialID;

[0276] uint32 instanceID;

[0277] uint64 primitiveID;

[0278] uint32 geometryID;

[0279] uint32 lightID;

[0280] float origin[3];

[0281] float direction[3];

[0282] float t0;

[0283] float t;

[0284] float time;

[0285] float normal[3]; / / used for geometric intersection

[0286] float u;

[0287] float v;

[0288] float wavelength;

[0289] float phase; / / interference method

[0290] float refractedOffset; / / Schlieren-esque

[0291] float amplitude;

[0292] float weight;

[0293] };

[0294] Rather than sending the raw data for each and every node generated, the data can be compressed by grouping the values ​​and creating implicit rays with applicable metadata where possible.

[0295] Bundling and grouping ray data

[0296] Flags can be used on common data or in masks with modifiers.

[0297] struct RayPacket

[0298] {

[0299] uint32 size;

[0300] uint32 flags;

[0301] list<ray>rays;

[0302] }

[0303] For example:

[0304] RayPacket.rays=ray_1to ray_256

[0305] All origins are shared

[0306] All ray data is packed, except that only a single origin is stored across all rays. Set RayPacket.flags to RAYPACKET_COMMON_ORIGIN. When a RayPacket is unpacked upon receipt, fill in the origin from the single origin value.

[0307] The origin is only shared between some rays

[0308] All ray data is packed, except for rays that share an origin. For each group with multiple unique shared origins, an operator is packed that identifies the operation (the shared origin), stores the origin, and masks which rays share information. This can be done for any shared value between multiple nodes, such as material IDs, primitive IDs, origins, directions, normals, etc.

[0309] struct RayOperation

[0310] {

[0311] uint8 operationID;

[0312] void*value;

[0313] uint64 mask;

[0314] }

[0315] Sending Implicit Rays Many times, ray data can be derived on the receiving end with minimal meta information used to generate that ray data. A very common example is generating multiple secondary rays to randomly sample an area. Instead of the sender generating a secondary ray, sending it, and the receiver operating on it, a command can be sent that generates a ray with any attribute information needed, and the ray is generated on the receiving end. In cases where a ray needs to be generated by the sender first to determine which receiver to send it to, a ray is generated and a random seed can be sent to regenerate the exact same ray.

[0316] For example, to sample a hit point with 64 shadow rays that sample an area light, all 64 rays intersect the region from the same computation N4. A RayPacket is created with a common origin and normal. More data can be sent if you want the recipient to contribute to the shading of the resulting pixel, but for this example, let's assume we want to only return data on whether the ray hit another node. A RayOperation is created to generate the shadow ray operation, and is assigned the value of the lightID to sample, as well as a random seed. When N4 receives the ray packet, it generates fully populated ray data by filling all rays with the shared origin data, and setting the direction based on the lightID randomly sampled using the random seed to generate the same rays as generated by the original sender. When the results are returned, only the binary result for each ray needs to be returned, which can be passed by the mask to the ray.

[0317] Sending the original 64 rays in this example would use 104 bytes * 64 rays = 6656 bytes. If the return rays were also sent in their original form, this would also double to 13312 bytes. Using lossless compression where only the common ray origin, normal, and ray generation operations with seed and ID are sent, only 29 bytes are sent, of which 8 bytes are returned for the mask that was intersected. This results in a compression ratio of about 360:1 for the data that needs to be sent over the network. This does not include the overhead of processing the messages themselves, which will need to be identified in some way, but it depends on the implementation. Other operations can be performed for: recalculating the ray origin and direction from the pixelID for the main ray; recalculating the pixelID based on the range in the raypacket; and many other possible implementations for recalculating values. Similar operations can be used for any single ray or group of rays sent, including shadows, reflections, refractions, ambient occlusion, intersections, volume intersections, shading, bounce reflections, etc. in path tracing.

[0318] Fig.17 Additional details of two ray tracing nodes 1710-1711 are shown, which perform compression and decompression of ray tracing packets. Specifically, when the first ray tracing engine 1730 is ready to transmit data to the second ray tracing engine 1731, the ray compression circuit 1720 performs lossy and / or lossless compression of the ray tracing data as described herein (e.g., converting 32-bit values ​​to 8-bit values, replacing the original data to obtain instructions for reconstructing the data, etc.). The compressed ray packets 1701 are transmitted from the network interface 1725 to the network interface 1726 via a local network (e.g., 10Gb / s, 100Gb / s Ethernet). The ray decompression circuit then decompresses the ray packets when appropriate. For example, the ray decompression circuit can execute commands to reconstruct the ray tracing data (e.g., using a random seed to perform random sampling for lighting operations). The ray tracing engine 1731 then uses the received data to perform ray tracing operations.

[0319] In the reverse direction, ray compression circuitry 1741 compresses ray data, network interface 1726 transmits the compressed ray data over the network (e.g., using the techniques described herein), ray decompression circuitry 1740 decompresses the ray data if necessary, and ray tracing engine 1730 uses the data in ray tracing operations. Fig.17 Although shown as separate units in FIG. 1 , ray decompression circuits 1740-1741 may be integrated within ray tracing engines 1730-1731, respectively. For example, to the extent that the compressed ray data includes commands for reconstructing the ray data, these commands may be executed by each respective ray tracing engine 1730-1731.

[0320] like Fig.18 As shown in FIG. 1 , the ray compression circuit 1720 may include a lossy compression circuit 1801 for performing the lossy compression techniques described herein (e.g., converting 32-bit floating point coordinates to 8-bit integer coordinates) and a lossless compression circuit 1803 for performing lossless compression techniques (e.g., transmitting commands and data to allow the ray decompression circuit 1721 to reconstruct the data). The ray decompression circuit 1721 includes a lossy decompression circuit 1802 and a lossless decompression circuit 1804 for performing lossless decompression.

[0321] exist Fig.19 Another exemplary method is illustrated in . The method can be implemented on a ray tracing architecture or other architectures described herein, but is not limited to any particular architecture.

[0322] At 1900, ray data to be transmitted from a first ray tracing node to a second ray tracing node is received. At 1901, lossy compression circuitry performs lossy compression on the first ray tracing data, and at 1902, lossless compression circuitry performs lossless compression on the second ray tracing data. At 1903, the compressed ray tracing data is transmitted to the second ray tracing node. At 1904, lossy / lossless decompression circuitry performs lossy / lossless decompression of the ray tracing data, and at 1905, the second ray tracing node performs a ray tracing operation using the decompressed data.

[0323] The graphics processor with hardware accelerated hybrid ray tracing next presents a hybrid rendering pipeline that performs rasterization on the graphics core 1530 and ray tracing operations on the ray tracing core 1550, the graphics core 1530, and / or the CPU 1599 core. For example, rasterization and depth testing can be performed on the graphics core 1530 in place of the primary ray casting stage. The ray tracing core 1550 can then generate secondary rays for light reflections, refractions, and shadows. In addition, certain areas of the scene will be selected where the ray tracing core 1550 will perform ray tracing operations (e.g., based on material property thresholds such as high reflectivity levels), while other areas of the scene will be rendered using rasterization on the graphics core 1530. This hybrid implementation can be used for real-time ray tracing applications where latency is a critical issue.

[0324] The ray traversal architecture described below can, for example, perform programmable shading and control of ray traversal using existing single instruction multiple data (SIMD) and / or single instruction multiple thread (SIMT) graphics processors while using dedicated hardware to accelerate key functions such as BVH traversal and / or intersection. SIMD occupancy for non-coherent paths can be improved by regrouping the generated shaders at specific points during traversal and before shading. This is achieved using dedicated hardware that dynamically classifies shaders on the chip. Recursion is managed by splitting functions into extensions that are executed on return and regrouping the extensions before execution to obtain improved SIMD occupancy.

[0325] Programmable control of ray traversal / intersection is achieved by decomposing the traversal functionality into an inner traversal that can be implemented as fixed-function hardware and an outer traversal that executes on the GPU processor and enables programmable control through user-defined traversal shaders. The cost of transferring traversal context between hardware and software is reduced by conservatively truncating the inner traversal state during the transition between inner and outer traversals.

[0326] Programmable control over ray tracing can be represented by different shader types listed below in Table A. There can be multiple shaders for each type. For example, each material can have a different hit shader.

[0327] Shader Types Function host Shooting the main ray Hit Bidirectional reflectance distribution function (BRDF) sampling, emitting secondary rays Any hit Calculating transmittance of alpha-textured geometry miss Calculates radiation from light sources intersect Intersecting custom shapes Traversal Instance selection and transformation Callable Universal Functions

[0328] Table A

[0329] Recursive ray tracing is initiated by an API function that commands the graphics processor to start a set of primary shaders, or an intersection circuit that can generate ray-scene intersections for primary rays. This in turn generates other shaders, such as traversal shaders, hit shaders, or miss shaders. The shader that generates a child shader can also receive a return value from the child shader. A callable shader is a general function that can be directly generated by another shader and can also return a value to the calling shader.

[0330] Fig. 20 The diagram shows a graphics processing architecture including a shader execution circuit 2000 and a fixed function circuit 2010. The general execution hardware subsystem includes: multiple single instruction multiple data (SIMD) and / or single instruction multiple threads (SIMT) cores / execution units (EUs) 2001 (i.e., each core may include multiple execution units), one or more samplers 2002, and a first level (Level 1, L1) cache 2003 or other forms of local memory. The fixed function hardware subsystem 2010 includes a message passing unit 2004, a scheduler 2007, a ray-BVH traversal / intersection circuit 2005, a sorting circuit 2008, and a local L1 cache 2006.

[0331] In operation, the master dispatcher 2009 dispatches a set of master rays to the scheduler 2007, which dispatches work to shaders executing on the SIMD / SIMT core / EU 2001. The SIMD core / EU 2001 may be the ray tracing core 1550 and / or the graphics core 1530 described above. The execution of the master shader generates additional work to be executed (e.g., to be executed by one or more child shaders and / or fixed function hardware). The message passing unit 2004 distributes the work generated by the SIMD core / EU 2001 to the scheduler 2007 (thereby accessing a free stack pool as needed), the sorting circuit 2008, or the ray-BVH intersection circuit 2005. If additional work is sent to the scheduler 2007, the additional work is scheduled for processing on the SIMD / SIMT core / EU 2001. Prior to scheduling, sorting circuitry 2008 may sort rays into groups or bins as described herein (e.g., to group rays with similar characteristics). Ray-BVH intersection circuitry 2005 performs intersection testing of rays using the BVH volume. For example, ray-BVH intersection circuitry 2005 may compare ray coordinates to the BVH at each level to identify volumes intersected by the ray.

[0332] A shader can be referenced using: a shader record; a user-allocated structure that includes a pointer to an entry function; vendor-specific metadata; and global arguments for shaders executed by SIMD Core / EU 2001. Each execution instance of a shader is associated with a call stack that can be used to store arguments passed between parent and child shaders. The call stack can also store references to extension functions that are executed when a call returns.

[0333] Fig.21 An example set of assigned stacks 2101 is shown, including a main shader stack, a hit shader stack, a traversal shader stack, a continuation function stack, and a ray-BVH intersection stack (which may be executed by fixed function hardware 2010 as described). A new shader call may implement a new stack from a free stack pool 2102. Call stacks (e.g., stacks included in the set of assigned stacks) may be cached in local L1 caches 2003, 2006 to reduce latency of access.

[0334] There may be a finite number of call stacks, each with a fixed maximum size "Sstack" allocated in a contiguous region of memory. Therefore, the base address of the stack can be calculated directly from the stack index (SID) as: base address = SID * Sstack. When scheduling work to SIMD core / EU 2001, the stack ID can be allocated and deallocated by the scheduler 2007.

[0335] The master dispatcher 2009 may include a graphics processor command processor that dispatches master shaders in response to dispatch commands from a host (e.g., a CPU). The scheduler 2007 may receive these dispatch requests and start the master shader on a SIMD processor thread if it can allocate a stack ID for each SIMD lane. The stack ID may be allocated from a free stack pool 2102 that is initialized at the start of a dispatch command.

[0336] The execution shader may generate a child shader by sending a generate message to the messaging unit 2004. The command includes the stack ID associated with the shader and also includes a pointer to the child shader record for each active SIMD channel. The parent shader may issue this message only once for the active channel. After sending the generate message for all relevant channels, the parent shader may terminate.

[0337] The shader executed on the SIMD core / EU 2001 can also generate fixed function tasks such as ray-BVH intersection using a generate message with a shader record pointer reserved for fixed function hardware. As mentioned, the message passing unit 2004 sends the generated ray-BVH intersection work to the fixed function ray-BVH intersection circuit 2005, and directly sends the callable shader to the sorting circuit 2008. The sorting circuit can group the shaders by the shader record pointer to derive SIMD batches with similar characteristics. Accordingly, the stack IDs from different parent shaders can be grouped in the same batch by the sorting circuit 2008. The sorting circuit 2008 sends the grouped batches to the scheduler 2007, which accesses the shader record from the graphics memory 2511 or the last level cache (LLC) 2020 and starts the shader on the processor thread.

[0338] Extensions can be treated as callable shaders and can also be referenced via shader records. When a child shader is generated and returns a value to the parent shader, a pointer to the extension shader record can be pushed onto the call stack 2101. When the child shader returns, the extension shader record can then be popped from the call stack 2101 and the extension shader can be generated. Optionally, the generated extension can be started on a processor thread by a sorting unit similar to the callable shader. As in Fig. 22 As shown in , the sorting circuit 2008 groups the generated tasks by shader record pointers 2201A, 2201B, 2201n to create SIMD batches to be shaded. Stack IDs or context IDs from different dispatches and different input SIMD channels can be grouped in sorted batches. The grouping circuit 2210 can use a content addressable memory (CAM) structure 2201 to perform the sorting, and the CAM structure 2201 includes a plurality of entries, each of which is identified by a tag 2201. As mentioned, the tag 2201 can be a corresponding shader record pointer 2201A, 2201B, 2201n. The CAM structure 2201 can store a limited number of (e.g., 32, 64, 128, etc.) tags, each of which is associated with an incomplete SIMD batch corresponding to a shader record pointer.

[0339] For incoming generation commands, each SIMD channel has a corresponding stack ID (shown as 16 context IDs 0-15 in each CAM entry) and a shader record pointer 2201A-B, ... n (serving as a tag value). The grouping circuit 2210 can compare the shader record pointer for each channel with the tag 2201 in the CAM structure 2201 to find a matching batch. If a matching batch is found, the stack ID / context ID can be added to the batch. Otherwise, a new entry with a new shader record pointer tag can be created, thereby possibly expelling an older entry with an incomplete batch.

[0340] When the call stack is empty, the execution shader can deallocate the call stack by sending a deallocation message to the messaging unit. The deallocation message is relayed to the scheduler, which returns the stack ID / context ID for the active SIMD lane to the free pool.

[0341] A hybrid approach for ray traversal operations using a combination of fixed-function ray traversal and software ray traversal is proposed. Thus, the approach provides the flexibility of software traversal while maintaining the efficiency of fixed-function traversal. Fig.23 An acceleration structure that can be used for hybrid traversal is shown, which is a two-level tree with a single top-level BVH 2300 and several bottom-level BVHs 2301 and 2302. Graphic elements are shown on the right to indicate inner traversal paths 2303, outer traversal paths 2304, traversal nodes 2305, leaf nodes with triangles 2306, and leaf nodes with custom primitives 2307.

[0342] The leaf node 2306 with triangle in the top level BVH 2300 can quote the triangle intersection shader record for custom graphics primitives, or quote the traversal shader record. The leaf node 2306 with triangle in the bottom level BVH 2301-2302 can only quote the triangle intersection shader record for custom graphics primitives. The type of reference is encoded in the leaf node 2306. Internal traversal refers to the traversal in each BVH 2300-2302. The internal traversal operation includes the calculation of the intersection of light and BVH, and the traversal across the BVH structure 2300-2302 is called the outer traversal. The internal traversal operation can be efficiently implemented in fixed function hardware, and the outer traversal operation can be performed with acceptable performance using a programmable shader. Therefore, the internal traversal operation can be performed using a fixed function circuit 2010, and the outer traversal operation can be performed using a shader execution circuit 2000 including a SIMD / SIMT core / EU 2001 for performing a programmable shader.

[0343] Note that for simplicity, the SIMD / SIMT core / EU 2001 is sometimes referred to herein as simply a "core," "SIMD core," "EU," or "SIMD processor." Similarly, the ray-BVH traversal / intersection circuit 2005 is sometimes referred to herein as simply a "traversal unit," "traversal / intersection unit," or "traversal / intersection circuit." When alternative terminology is used, the specific name used to designate the corresponding circuit / logic does not change the underlying functionality performed by that circuit / logic as described herein.

[0344] In addition, although Fig. 20 2005 is illustrated as a single component for purposes of explanation, but the traversal / intersection unit 2005 may include different traversal units and a separate intersection unit, each of which may be implemented in circuits and / or logic as described herein.

[0345] When the ray intersects the traversal node during the inner traversal, the traversal shader can be generated. The sorting circuit 2008 can group these shaders to create a SIMD batch through the shader record pointer 2201A-B,n, and the SIMD batch is started by the scheduler 2007 for SIMD execution on the graphics SIMD core / EU 2001. The traversal shader can modify the traversal in several ways, thereby realizing a wide range of applications. For example, the traversal shader can select a BVH or transform light to enable strict body transformation with a coarser level of detail (LOD). The traversal shader can then generate an inner traversal for the selected BVH.

[0346] The inner pass computes ray-BVH intersections by traversing the BVH and computing ray-box intersections and ray-triangle intersections. The inner pass is generated in the same manner as the shader by sending messages to the message passing circuit 2004, which relays the corresponding generated messages to the ray-BVH intersection circuit 2005, which computes the ray-BVH intersections.

[0347] The stack for the inner traversal can be stored locally in the fixed function circuit 2010 (e.g., in the L1 cache 2006). When the ray intersects with the leaf node corresponding to the traversal shader or the intersection shader, the inner traversal can be terminated and the inner stack is truncated. The truncated stack can be written to the location specified by the calling shader in the memory together with the pointer to the ray and the BVH, and then the corresponding traversal shader or intersection shader can be generated. If the ray intersects with any triangle during the inner traversal, the corresponding hit information can be provided as an input parameter to these shaders, as shown in the code below. These generated shaders can be grouped by the sorting circuit 2008 to create a SIMD batch for execution.

[0348]

[0349] Truncating the inner traversal stack reduces the cost of spilling the inner traversal stack to memory. The method described in RestartTrail for Stackless BVH Traversal, High Performance Graphics (2010), pp. 107-111 can be applied to truncate the stack to a small number of entries at the top of the stack, i.e., a 42-bit restart path and a 6-bit depth value. The restart path indicates the branch that has been taken inside the BVH, and the depth value indicates the depth of the traversal corresponding to the last stack entry. This is enough information to resume the inner traversal at a later time.

[0350] When the inner stack is empty and there are no more BVH nodes to test, the inner traversal is complete. In this case, an outer stack handler is generated, which pops the top of the outer stack and resumes traversal if the outer stack is not empty.

[0351] The outer traversal may execute the main traversal state machine and may be implemented in program code executed by the shader execution circuit 2000. The shader execution circuit 2000 may generate an inner traversal query under the following conditions: (1) when a new ray is generated by a hit shader or a main shader; (2) when a traversal shader selects a BVH to traverse; and (3) when the outer stack handler resumes the inner traversal for the BVH.

[0352] As in Fig.24 As illustrated in , before generating the inner traversal, space is allocated on the call stack 2405 for the fixed function circuit 2010 to store the truncated inner stack 2410. Offsets 2403-2404 to the top of the call stack and the inner stack are maintained in the traversal state 2400, which is also stored in the memory 2511. The traversal state 2400 also includes a ray 2401 in world space and a ray 2402 in object space and hit information for the nearest intersecting primitive.

[0353] Traversal shaders, intersection shaders, and outer stack handlers are all generated by the ray-BVH intersection circuit 2005. Traversal shaders are allocated on the call stack 2405 before initiating a new inner traversal for the second level BVH. The outer stack handler is the shader responsible for updating hit information and resuming any pending inner traversal tasks. The outer stack handler is also responsible for generating a hit or miss shader when the traversal is completed. When there are no pending inner traversal queries to be generated, the traversal is completed. When the traversal is completed and the intersection is found, a hit shader is generated; otherwise a miss shader is generated.

[0354] Although the hybrid traversal scheme described above uses a two-level BVH hierarchy, any number of BVH levels and corresponding changes in the outer traversal implementation may be implemented.

[0355] Furthermore, while the fixed function circuit 2010 is described above as being used to perform ray-BVH intersections, other system components may also be implemented in fixed function circuits. For example, the outer stack handler described above may be an internal (non-user visible) shader that may potentially be implemented in the fixed function BVH traversal / intersection circuit 2005. This implementation may be used to reduce the number of shader stages dispatched and the number of round trips between the fixed function intersection hardware 2005 and the processor.

[0356] This article describes examples that use user-defined functions to enable programmable shading and ray traversal control, which can be executed on existing and future GPU processors with higher SIMD efficiency. Programmable control of ray traversal enables several important features, such as procedural instancing, random level of detail selection, custom primitive intersections, and lazy BVH updates. A programmable multiple instruction multiple data (MIMD) ray tracing architecture that supports speculative execution of hit shaders and intersection shaders is also provided. Specifically, the architecture focuses on reducing the overhead of the above reference Fig. 20 The scheduling and communication overhead between the programmable SIMD / SIMT core / execution unit 2001 and the fixed-function MIMD traversal / intersection unit 2005 in the hybrid ray tracing architecture described above is reduced. In the following, multiple speculative execution schemes for hit shaders and intersection shaders are described, which can be dispatched in a single batch from the traversal hardware, thereby avoiding several traversal and shading round trips. Dedicated circuits for implementing these techniques can be used.

[0357] Embodiments of the present invention are particularly beneficial in use cases where ray traversal queries expect the execution of multiple hit shaders or intersection shaders, which can incur significant overhead when implemented without dedicated hardware support. These include, but are not limited to, nearest-k hit queries (launching a hit shader for the k nearest intersections) and multiple programmable intersection shaders.

[0358] The techniques described herein can be implemented as Fig. 20 Figure (and see Figure 20-24 Description) of the invention. Specifically, the current embodiment of the invention builds on that architecture with enhancements to improve performance for the use cases described above. The performance limitations of the hybrid ray tracing traversal architecture are the overhead of launching traversal queries from the execution units and the overhead of calling programmable shaders from the ray tracing hardware. This overhead generates "execution round trips" between the programmable core 2001 and the traversal / intersection unit 2005 when multiple hit shaders or intersection shaders are called during the traversal of the same ray. This also puts additional pressure on the sorting unit 2008, which needs to extract SIMD / SIMT consistency from the various shader calls.

[0359] Several aspects of ray tracing require programmable control that can be expressed through the different shader types listed in Table A above (i.e., primary, hit, any-hit, miss, intersection, traversal, and callable). There may be multiple shaders for each type. For example, each material may have a different hit shader. In the current Some of these shader types are defined in the Ray Tracing API.

[0360] As a brief review, recursive ray tracing is initiated by an API function that instructs the GPU to start a set of master shaders (implemented in hardware and / or software) that can generate ray-scene intersections for the primary ray. This in turn can generate other shaders, such as traversal shaders, hit shaders, or miss shaders. The shader that generates child shaders can also receive return values ​​from the shader. A callable shader is a general function that can be directly generated by another shader and can also return a value to the calling shader.

[0361] Ray traversal computes ray-scene intersection by traversing nodes in a bounding volume hierarchy (BVH) and intersecting them. Recent research has shown that the efficiency of computing ray-scene intersection can be improved by more than an order of magnitude using techniques more suitable for fixed-function hardware, such as reduced-precision arithmetic, BVH compression, per-ray state machines, dedicated intersection pipelines, and custom caching.

[0362] exist Fig. 20 The architecture shown in 2001 includes such a system in which an array of SIMD / SIMT cores / execution units interacts with a fixed function ray tracing / intersection unit 2005 to perform programmable ray tracing. Programmable shaders are mapped to SIMD / SIMT threads on execution units / cores 2001, where SIMD / SIMT utilization, execution, and data consistency are critical for optimal performance. Ray queries often break consistency for various reasons such as the following:

[0363] · Ergodic Divergence : The duration of a BVH traversal varies widely between rays that support asynchronous ray processing.

[0364] · Execution divergence : Rays generated from different channels of the same SIMD / SIMT thread result in different shader invocations.

[0365] · Data access divergence : For example, rays hitting different surfaces sample different BVH nodes and primitives, and shaders access different textures. Various other scenarios can cause data access divergence.

[0366] SIMD / SIMT core / execution unit 2001 may be a variant of the core / execution unit described herein, including (one or more) graphics cores 415A-415B, shader cores 1355A-1355N, graphics core 1530, graphics execution unit 608, execution units 852A-852B, or any other core / execution unit described herein. SIMD / SIMT core / execution unit 2001 may be used in place of (one or more) graphics cores 415A-415B, shader cores 1355A-1355N, graphics core 1530, graphics execution unit 608, execution units 852A-852B, or any other core / execution unit described herein. Thus, any disclosure of features in conjunction with graphics core(s) 415A-415B, shader cores 1355A-1355N, graphics core 1530, graphics execution unit 608, execution units 852A-852B, or any other core / execution unit described herein also discloses features related thereto. Fig. 20 The present invention may be a corresponding combination of SIMD / SIMT core / execution unit 2001, but is not limited thereto.

[0367] The fixed function ray tracing / intersection unit 2005 can overcome the first two challenges by processing each ray individually and out of order. However, that breaks up the SIMD / SIMT groups. Therefore, the sorting unit 2008 is responsible for forming new, consistent SIMD / SIMT groups of shader invocations for being dispatched to execution units again.

[0368] It is easy to see the benefits of this architecture compared to a pure software-based ray tracing implementation directly on a SIMD / SIMT processor. However, there is overhead associated with messaging between the SIMD / SIMT core / execution unit 2001 (sometimes referred to herein simply as a SIMD / SIMT processor or core / EU) and the MIMD traversal / intersection unit 2005. Furthermore, the sorting unit 2008 may not be able to extract perfect SIMD / SIMT utilization from inconsistent shader calls.

[0369] Use cases can be identified where shader invocations may be particularly frequent during a traversal. Enhancements are described for enabling a hybrid MIMD ray tracing processor to significantly reduce the overhead of communications between the core / EU 2001 and the traversal / intersection unit 2005. This can be particularly beneficial when finding k-nearest intersections and implementing programmable intersection shaders. Note, however, that the techniques described herein are not limited to any particular processing scenario.

[0370] A summary of the high-level cost of ray tracing context switches between the core / EU 2001 and the fixed-function traversal / intersection unit 2005 is provided below. Most of the performance overhead is incurred by these two context switches whenever a shader call is necessary during a single ray traversal.

[0371] Each SIMD / SIMT lane that fires a ray generates a generate message to the traversal / intersection unit 2005 associated with the BVH to be traversed. The data (ray traversal context) is relayed to the traversal / intersection unit 2005 via the generate message and (cached) memory. When the traversal / intersection unit 2005 is ready to assign a new hardware thread to the generate message, it loads the traversal state and performs a traversal on the BVH. There is also a setup cost that needs to be performed before the first traversal step on the BVH. Fig.25 The operation flow of a programmable ray tracing pipeline is illustrated. The shaded elements including traversal 2502 and intersection 2503 can be implemented in fixed function circuits, while the remaining elements can be implemented using programmable cores / execution units.

[0372] The primary ray shader 2501 sends work to the traversal circuit at 2502, which traverses the current ray(s) through the BVH (or other acceleration structure). When a leaf node is reached, the traversal circuit calls the intersection circuit at 2503, which, after identifying ray-triangle intersections, calls any hit shader at 2504 (which may provide results back to the traversal circuit as indicated).

[0373] Alternatively, the traversal may be terminated before reaching a leaf node and the most recently hit shader called at 2507 (if a hit was recorded) or the miss shader called at 2506 (in the case of a miss).

[0374] As indicated at 2505, if the traversal circuit reaches a custom primitive leaf node, an intersection shader may be called. A custom primitive may be any non-triangular primitive, such as a polygon or polyhedron (e.g., a tetrahedron, voxel, hexahedron, wedge, pyramid, or other "unstructured" volume). The intersection shader 2505 identifies any intersections between the ray and the custom primitive to any hit shader 2504 that implements any hit processing.

[0375] When the hardware traversal 2502 reaches the programmable stage, the traversal / intersection unit 2005 can generate a shader dispatch message to the relevant shader 2505-2507, which corresponds to a single SIMD channel of the (one or more) execution units used to execute the shader. Since dispatches occur in an arbitrary ray order and they are divergent in the called program, the sorting unit 2008 can accumulate multiple dispatch calls to extract consistent SIMD batches. The updated traversal state and optional shader parameters can be written to the memory 2511 by the traversal / intersection unit 2005.

[0376] In the k nearest intersection problem, the nearest hit shader 2507 is executed for the first k intersections. Traditionally, this would mean: ending the ray traversal after finding the nearest intersection; calling the hit shader; and spawning a new ray from the hit shader to find the next nearest intersection (with the ray origin offset so the same intersection will not occur again). It is easy to see that this implementation would require k ray gens for a single ray. Another implementation operates using an intersection sorting operation using any hit shader 2504, which is called for all intersections and maintains a global list of nearest intersections. The main problem with this approach is that there is no upper bound on any hit shader invocation.

[0377] As mentioned, the intersection shader 2505 may be called for non-triangle (custom) primitives. Depending on the results of the intersection test and the traversal state (pending nodes and primitive intersections), traversal of the same ray may continue after execution of the intersection shader 2505. Therefore, finding the most recent hit may require several round trips to the execution unit.

[0378] Can also focus on reducing the SIMD-MIMD context switch for intersection shader 2505 and hit shader 2504,2507 by the change of traversal hardware and shader scheduling model.First, the light traversal circuit 2005 postpones shader call by accumulating multiple potential calls and dispatching them with larger batches.In addition, some calls proved to be unnecessary can be eliminated at this stage.In addition, shader scheduler 2007 can aggregate multiple shader calls from the same traversal context into a single SIMD batch, which produces a single light generation message.In an exemplary implementation, traversal hardware 2005 stops the traversal thread and waits for the result of multiple shader calls.Here this mode of operation is referred to as "speculative" shader execution, because it allows multiple shaders to be dispatched, and some shaders in these shaders may not be called when using sequential calls.

[0379] Fig.26A illustrates an example in which a traversal operation encounters multiple custom primitives 2650 in a subtree, and Fig.26B The diagram illustrates how to solve this problem using three intersecting dispatch loops C1-C3. Specifically, the scheduler 2007 may need three cycles to submit work to the SIMD processor 2001, and the traversal circuit 2005 may need three cycles to provide the results to the sorting unit 2008. The traversal state 2601 required by the traversal circuit 2605 may be stored in a memory such as a local cache (e.g., an L1 cache and / or an L2 cache).

[0380] A. Deferred ray tracing shader invocation

[0381] The manner in which the hardware traversal state 2601 is managed may also be modified to allow for accumulation of multiple potential intersections or hit calls in a list. At a given time during a traversal, each entry in the list may be used to generate a shader call. For example, the k closest intersections may be accumulated on the traversal hardware 2005 and / or in the traversal state 2601 in memory, and if the traversal is complete, a hit shader may be called for each element. For a hit shader, multiple potential intersections may be accumulated for a subtree in a BVH.

[0382] For the nearest k use case, the benefit of this approach is that all hit shaders are called from the same traversal thread during a single traversal operation on the traversal circuit 2005, without k-1 round trips to the SIMD core / EU 2001 and k-1 new ray generation messages. One challenge for potential implementations is that it is not trivial to guarantee the order in which the hit shaders are executed (the standard "round trip" approach guarantees that the most recently intersected hit shader is executed first, etc.). This can be addressed by synchronization of the hit shaders or by relaxing the ordering.

[0383] For the intersection shader use case, the traversal circuit 2005 does not know in advance whether a given shader will return a positive intersection test. However, it is possible to speculatively execute multiple intersection shaders, and if at least one intersection shader returns a positive hit result, it is merged into the global nearest hit. The specific implementation method needs to find the optimal number of deferred intersection tests to reduce the number of dispatch calls but avoid calling too many redundant intersection shaders.

[0384] B. Calling from a traversal circuit aggregation shader

[0385] When multiple shaders from the same ray generation are dispatched on the traversal circuit 2005, branches in the flow of the ray traversal algorithm can be created. This can be problematic for intersection shaders, since the rest of the BVH traversal depends on the results of all dispatched intersection tests. This means that synchronization operations necessarily wait for the results of the shader invocation, which can be challenging on asynchronous hardware.

[0386] The two points where the results of shader calls are merged can be: SIMD processor 2001 and traversal circuit 2005. With respect to SIMD processor 2001, multiple shaders can use standard programming models to synchronize and aggregate their results. A relatively simple way to do this is to use global atomicity and aggregate the results in a shared data structure in memory, where the intersected results of multiple shaders can be stored. The last shader can then parse the data structure and call back traversal circuit 2005 to continue the traversal.

[0387] A more efficient approach can also be implemented that restricts the execution of multiple shader invocations to the lanes of the same SIMD thread on the SIMD processor 2001. The intersection tests are then reduced locally using SIMD / SIMT reduce operations (rather than relying on global atomicity). This implementation can rely on new circuitry within the sorting unit 2008 to keep small batches of shader invocations in the same SIMD batch.

[0388] The execution of the traversal thread may be further suspended on the traversal circuit 2005. Using a conventional execution model, when a shader is dispatched during a traversal, the traversal thread is terminated and the ray traversal state is saved to memory to allow other ray generation commands to be executed while the shader is processed by the execution unit 2001. If only the traversal thread is suspended, the traversal state does not need to be stored and the traversal state may wait for each shader result separately. The implementation may include circuitry for avoiding deadlock and providing sufficient hardware utilization.

[0389] Figure 27-Figure 28 An example of a deferral model is shown that invokes a single shader call on a SIMD core / execution unit 2001 with three shaders 2701. When reserved, all intersection tests are evaluated within the same SIMD / SIMT group. Therefore, the nearest intersection can also be calculated on the programmable core / execution unit 2701.

[0390] As mentioned, all or part of shader aggregation and / or deferral may be performed by traversal / intersection circuitry 2005 and / or core / EU scheduler 2007 . Fig. 27 27. The diagram illustrates how the shader deferral / aggregator circuit 2706 within the scheduler 2007 can defer the scheduling of shaders associated with a particular SIMD / SIMT thread / lane until a specified triggering event has occurred. Upon detecting a triggering event, the scheduler 2007 dispatches multiple aggregated shaders in a single SIMD / SIMT batch to the core / EU 2001.

[0391] Fig.28 2805 within the traversal / intersection circuit 2005 is illustrated as being able to defer the scheduling of shaders associated with a particular SIMD thread / lane until a specified triggering event has occurred. Upon detecting a triggering event, the traversal / intersection circuit 2005 submits the aggregated shaders to the sorting unit 2008 in a single SIMD / SIMT batch.

[0392] Note, however, that shader deferral and aggregation techniques may be implemented within various other components, such as the sorting unit 2008, or may be distributed across multiple components. For example, the traversal / intersection circuit 2005 may perform a first set of shader aggregation operations, and the scheduler 2007 may perform a second set of shader aggregation operations to ensure that shaders for SIMD threads are efficiently scheduled on the core / EU 2001.

[0393] The "trigger event" for causing aggregated shaders to be dispatched to a core / EU can be a processing event, such as a specific number of accumulated shaders or a minimum wait time associated with a specific thread. Alternatively or additionally, the trigger event can be a temporal event, such as a certain duration or a specific number of processor cycles starting from the postponement of the first shader. Other variables, such as the current workload on the core / EU 2001 and the traversal / intersection unit 2005, can also be evaluated by the scheduler 2007 to determine when to dispatch SIMD / SIMT batches of shaders.

[0394] Different combinations of the above methods may be used to implement different embodiments of the present invention, depending on the specific system architecture used and the requirements of the application.

[0395] Ray Tracing Instructions The ray tracing instructions described below are included in an instruction set architecture (ISA) supported by the CPU 1599 and / or GPU 1505. If executed by the CPU, single instruction multiple data (SIMD) instructions can utilize vector / packed source and destination registers to perform the described operations and can be decoded and executed by the CPU core. If executed by the GPU 1505, the instructions can be executed by the graphics core 1530. For example, any of the above-mentioned execution units (EU) 2001 can execute the instructions. Alternatively or additionally, the instructions can be executed by execution circuits on the ray tracing core 1550 and / or the tensor core 1540.

[0396] Fig.29 The illustrated architecture is used to execute the ray tracing instructions described below. The illustrated architecture can be integrated into the cores 1530, 1540, 1550 described above (see, for example, Fig.15 and associated text), or may be included in different processor architectures.

[0397] In operation, instruction fetch unit 2903 fetches ray tracing instructions 2900 from memory 1598, and decoder 2995 decodes the instructions. In one implementation, decoder 2995 decodes the instructions to generate executable operations (e.g., micro-operations or uops in a micro-coded core). Alternatively, some or all of ray tracing instructions 2900 may be executed without decoding, and thus decoder 2904 is not required.

[0398] In either implementation, the scheduler / dispatcher 2905 schedules and dispatches instructions (or operations) across a set of functional units (FUs) 2910-2912. The illustrated implementation includes a vector FU 2910 for executing single instruction multiple data (SIMD) instructions that operate simultaneously on multiple packed data elements stored in vector registers 2915 and a scalar FU 2911 for operating on scalar values ​​stored in one or more scalar registers 2916. An optional ray tracing FU 2912 can operate on packed data values ​​stored in vector registers 2915 and / or scalar values ​​stored in scalar registers 2916. In implementations without a dedicated FU 2912, the vector FU 2910, and possibly the scalar FU 2911, can execute the ray tracing instructions described below.

[0399] Each FU 2910-2912 accesses ray tracing data 2902 (e.g., traversal / intersection data) required to execute ray tracing instructions 2900 from vector registers 2915, scalar registers 2916, and / or a local cache subsystem 2908 (e.g., L1 cache). FUs 2910-2912 may also perform access to memory 1598 via load and store operations, and the cache subsystem 2908 may operate independently to cache data locally.

[0400] While ray tracing instructions can be used to improve the performance of ray traversal / intersection and BVH construction, ray tracing instructions can also be applied to other areas, such as high performance computing (HPC) and general purpose GPU (GPGPU) implementations.

[0401] In the following description, the term "double word" is sometimes abbreviated as dw, and unsigned byte is abbreviated as ub. In addition, the source and destination registers mentioned below (e.g., src0, src1, dest, etc.) can point to a quantity register 2915, or in some cases a combination of a quantity register 2915 and a scalar register 2916. Typically, if the source or destination value used by the instruction includes packed data elements (e.g., where the source or destination stores N data elements), a vector register 2915 is used. Other values ​​can use a scalar register 2916 or a vector register 2915.

[0402] Dequantize

[0403] An example of a dequantize instruction "dequantizes" a previously quantized value. As an example, in a ray tracing implementation, certain BVH subtrees may be quantized to reduce storage and bandwidth requirements. The dequantize instruction may take the form of dequantizedestsrc0 src1 src2, where source register src0 stores N unsigned bytes, source register src1 stores 1 unsigned byte, source register src2 stores 1 floating point value, and destination register dest stores N floating point values. All of these registers may be vector registers 2915. Alternatively, src0 and dest may be vector registers 2915, and src1 and src2 may be scalar registers 2916.

[0404] The following code sequence defines a specific implementation of the dequantize instruction:

[0405]

[0406] In this example, ldexp multiplies a double-precision floating-point value by a specified integer power of 2 (i.e., ldexp(x, exp) = x*2 exp In the above code, if the execution mask value (execMask[i]) associated with the current SIMD data element is set to 1, the SIMD data element at position i in src0 is converted to a floating point value and multiplied by an integer power (2 src1 value) and adds that value to the corresponding SIMD data element in src2.

[0407] Selective minimum or maximum value

[0408] As indicated by the bits in a bitmask, a selective minimum or maximum instruction can perform a minimum or maximum operation on a per-channel basis (i.e., return the minimum or maximum of a set of values). The bitmask can utilize vector register 2915, scalar register 2916, or a separate set of mask registers (not shown). The following code sequence defines a particular implementation of the minimum / maximum instruction: sel_min_max dest src0 src1 src2, where src0 stores N doublewords, src1 stores N doublewords, src2 stores a single doubleword, and the destination register stores N doublewords.

[0409] The following code sequence defines a particular implementation of the selective minimum / maximum instruction:

[0410]

[0411] In this example, the value of (1<<i)&src2 (a1 shifted left by i ANDed with src2) is used to select the minimum or maximum of the i-th data element in src0 and src1. The operation is performed on the i-th data element only if the execution mask value (execMask[i]) associated with the current SIMD data element is set to 1.

[0412] Shuffle Index Instructions

[0413] The shuffle index instruction can copy any set of input channels to output channels. For a SIMD width of 32, this instruction can be executed with a lower throughput. The instruction takes the following form: shuffle_index dest src0 src1 <optional flag>, where src0 stores N doublewords, src1 stores N unsigned bytes (i.e., index values), and dest stores N doublewords.

[0414] The following code sequence defines a particular implementation of the shuffle index instruction:

[0415]

[0416] In the above code, the index in src1 identifies the current lane. If the i-th value in the execution mask is set to 1, a check is performed to ensure that the source lane is in the range of 0 to the SIMD width. If so, a flag is set (srcLaneMod), and data element i of the destination is set equal to data element i of src0. If the lane is in range (i.e., valid), the index value from src1 (srcLane0) is used as an index into src0 (dst[i] = src0[srcLane]).

[0417] Immediate shuffle Up / Dn / XO (up / down / exclusive OR) instructions

[0418] The immediate shuffle instruction can shuffle the input data elements / lanes based on the immediate value of the instruction. Based on the value of the immediate value, the immediate value can specify that the input lanes are shifted by 1, 2, 4, 8, or 16 positions. Optionally, an additional scalar source register can be specified as a fill value. When the source lane index is invalid, the fill value (if provided) is stored to the data element position in the destination. If no fill value is provided, the data element position is set to all 0s.

[0419] The flag register can be used as a source mask. If the flag bit for a source lane is set to 1, then the source lane can be marked as invalid and the instruction can continue.

[0420] The following are examples of different implementations of the immediate shuffle instruction:

[0421] shuffle_ <up dn xor>_<1 / 2 / 4 / 8 / 16>start src0<optional src1> <optionalflag>

[0422] shuffle_ <up dn xor>_<1 / 2 / 4 / 8 / 16>start src0<optional src1> <optionalflag>

[0423] In this implementation, src0 stores N double words, src1 stores one double word for the fill value (if any), and dest stores N double words containing the result.

[0424] The following code sequence defines a specific implementation of the immediate shuffle instruction:

[0425]

[0426]

[0427] Here, the input data element / lane is shifted 1, 2, 4, 8, or 16 positions based on the value of the immediate. Register src1 is an additional scalar source register that is used as a fill value to be stored into the data element position in the destination when the source lane index is invalid. If no fill value is provided and the source lane index is invalid, the data element position in the destination is set to 0. The flag register (FLAG) is used as a source mask. As described above, if the flag bit for the source lane is set to 1, the source lane is marked as invalid and the instruction continues.

[0428] Indirect shuffle Up / Dn / XOR (up / down / exclusive OR) instructions

[0429] An indirect shuffle instruction has a source operand (src1) that controls the mapping from the source lane to the destination lane. An indirect shuffle instruction can take the following forms:

[0430] shuffle_ <up dn xor>dest src0 src1<optional flag>

[0431] Where src0 stores N double words, src1 stores 1 double word, and dest stores N double words.

[0432] The following code sequence defines a specific implementation of the immediate shuffle instruction:

[0433]

[0434] Thus, the indirect shuffle instruction operates in a similar manner to the immediate shuffle instruction described above, but the mapping of the source lane to the destination lane is controlled by the source register src1 rather than the immediate value.

[0435] Cross-channel min / max instructions

[0436] Cross-lane minimum / maximum instructions may be supported for floating point and integer data types. A cross-lane minimum instruction may take the form of lane_min dest src0, and a cross-lane maximum instruction may take the form of lane_max dest src0, where src0 stores N double words and dest stores 1 double word.

[0437] As an example, the following code sequence defines a specific implementation of the cross-channel minimum:

[0438]

[0439] In this example, the doubleword value in data element position i of the source register is compared to the data element in the destination register and the minimum of the two values ​​is copied to the destination register. The cross-lane maximum instruction operates in essentially the same manner, with the only difference being the maximum of the data element in position i and the destination value is selected.

[0440] Cross-channel min / max indexing instructions

[0441] The cross-lane minimum index instruction may take the form of lane_min_index dest src0, and the cross-lane maximum index instruction may take the form of lane_max_index dest src0, where src0 stores N double words and dest stores 1 double word.

[0442] As an example, the following code sequence defines a specific implementation of the cross-lane minimum index instruction:

[0443]

[0444] In this example, the destination index increments from 0 to the SIMD width, straddling the destination register.If the execute mask bit is set, the data element at position i in the source register is copied to a temporary storage location (tmp) and the destination index is set to data element position i.

[0445] Cross-channel sorting network instructions

[0446] The cross-channel sorting network instruction can use an N-width (stable) sorting network to sort all N input elements in ascending order (sortnet_min, sorting network_minimum) or descending order (sortnet_max, sorting network_maximum). The minimum / maximum version of the instruction can take the form of sortnet_min dest src0 and sortnet_max dest src0, respectively. In one implementation, src0 and dest store N double words. Min / max sorting is performed on the N double words of src0, and the ascending elements (for minimum values) or descending elements (for maximum values) are stored in dest in their corresponding sort order. An example of a code sequence that defines the instruction is: dst = apply_N_wide_sorting_network_min / max(src0).

[0447] Cross-channel sorting network index instructions

[0448] The cross-channel sorting network index instruction can use an N-width (stable) sorting network to sort all N input elements in ascending order (sortnet_min) or descending order (sortnet_max) but return a permuted index. The min / max version of the instruction can take the form of sortnet_min_index dest src0 and sortnet_max_index dest src0, where src0 and dest each store N double words. An example of a code sequence defining the instruction is: dst = apply_N_wide_sorting_network_min / max_index(src0).

[0449] exist Fig.30 A method for executing any one of the above instructions is illustrated in FIG. The method can be implemented on the above-mentioned specific processor architecture, but is not limited to any specific processor or system architecture.

[0450] At 3001, instructions of the main graphics thread are executed on a processor core. This may include, for example, any of the cores described above (e.g., graphics core 1530). When it is determined at 3002 that ray tracing work is reached within the main graphics thread, the ray tracing instructions are migrated to ray tracing execution circuitry, which may be such as described above with respect to Fig.29 The ray tracing execution circuit may be in the form of a functional unit (FU) as described above, or the ray tracing execution circuit may be in the form of a functional unit (FU) as described above. Fig.15 The dedicated ray tracing core 1550 is described.

[0451] At 3003, the ray tracing instructions retrieved from the memory are decoded, and at 3005, the instructions are decoded into executable operations (e.g., in embodiments requiring a decoder). At 3004, the ray tracing instructions are scheduled and dispatched for execution by the ray tracing circuitry. At 3005, the ray tracing instructions are executed by the ray tracing circuitry. For example, the instructions may be dispatched to and executed on the above-mentioned FUs (e.g., vector FU 2910, ray tracing FU 2912, etc.) and / or graphics core 1530 or ray tracing core 1550.

[0452] When execution of the ray tracing instructions is complete, the results are stored at 3006 (e.g., stored back to memory 1598), and the main graphics thread is notified at 3007. At 3008, the ray tracing results are processed within the context of the main thread (e.g., read from memory and integrated into the graphics rendering results).

[0453] In embodiments, the term "engine" or "module" or "logic" may refer to, or may include, an application specific integrated circuit (ASIC), electronic circuit, processor (shared, dedicated or grouped) and / or memory (shared, dedicated or grouped) that executes one or more software or firmware programs, combinational logic circuits, and / or other suitable components that provide the described functionality. In embodiments, the engine, module or logic may be implemented in firmware, hardware, software, or any combination of firmware, hardware and software.

[0454] Apparatus and method for asynchronous ray tracing

[0455] Embodiments of the present invention include a combination of fixed-function acceleration circuits and general-purpose processing circuits to perform ray tracing. For example, certain operations associated with ray traversal and intersection testing of a bounding volume hierarchy (BVH) may be performed by fixed-function acceleration circuits, while multiple execution circuits execute various forms of ray tracing shaders (e.g., any hit shader, intersection shader, miss shader, etc.). One embodiment includes dual high-bandwidth storage blocks that include multiple entries for storing rays and corresponding dual stacks for storing BVH nodes. In this embodiment, the traversal circuit alternates between dual ray blocks and stacks to process rays on each clock cycle. In addition, one embodiment includes a priority selection circuit / logic that distinguishes between internal nodes, non-internal nodes, and primitives, and uses this information to intelligently prioritize the processing of BVH nodes and primitives defined by the BVH nodes.

[0456] A specific embodiment reduces the high-speed memory required for traversal by using a short stack to store a limited number of BVH nodes during a traversal operation. The embodiment includes a stack management circuit / logic for efficiently pushing entries to and popping entries from the short stack to ensure that the required BVH nodes are available. In addition, the traversal operation is tracked by performing updates to the tracking data structure. When the traversal circuit / logic is paused, it can consult the tracking data structure to start the traversal operation at the same location in the BVH where it stopped, and the tracking data maintained in the data structure tracking is executed so that the traversal circuit / logic can be restarted.

[0457] Fig.31 An embodiment is illustrated, including a shader execution circuit 2000 for executing shader program code and processing associated ray tracing data 2902 (e.g., BVH node data and ray data), a ray tracing acceleration circuit 3110 for performing traversal and intersection operations, and a memory 3198 for storing program code and associated data processed by the RT acceleration circuit 3110 and the shader execution circuit 2000.

[0458] In one embodiment, the shader execution circuit 2000 includes multiple cores / execution units 2001 that execute shader program code to perform various forms of data parallel operations. For example, in one embodiment, the core / execution unit 2001 can execute a single instruction across multiple channels, where each instance of the instruction operates on data stored in a different channel. In a SIMT implementation, for example, each instance of the instruction is associated with a different thread. During execution, the L1 cache stores certain ray tracing data for efficient access (e.g., recently or frequently accessed data).

[0459] The collection of primary rays may be dispatched to a scheduler 2007, which schedules work to shaders executed by core / EU 2001. Core / EU 2001 may be a ray tracing core 1550, a graphics core 1530, a CPU core 1599, or other types of circuitry capable of executing shader program code. One or more primary ray shaders 3101 process primary rays and generate additional work to be executed by ray tracing acceleration circuitry 3110 and / or core / EU 2001 (e.g., to be executed by one or more child shaders). New work generated by primary ray shaders 3101 or other shaders executed by core / EU 2001 may be distributed to a sorting circuit 2008, which sorts rays into groups or into bins as described herein (e.g., grouping rays with similar characteristics). Scheduler 2007 then schedules the new work on core / EU 2001.

[0460] Other shaders that can be executed include any hit shader 2514 and the nearest hit shader 2507, which process hit results as described above (e.g., identify any hit or nearest hit for a given ray, respectively). Miss shader 2506 processes ray misses (e.g., where the ray does not intersect with a node / primitive). As mentioned, various shaders can be referenced using shader records, which can include one or more pointers, vendor-specific metadata, and global parameters. In one embodiment, shader records are identified by shader record identifiers (shader record identifiers, SRI). In one embodiment, each execution instance of a shader is associated with a call stack 3121, which stores parameters passed between a parent shader and a child shader. The call stack 3121 can also store references to the extended functions that are executed when the call returns.

[0461] The ray traversal circuit 3102 traverses each ray through the nodes of the BVH, working down the hierarchy of the BVH (e.g., through parent nodes, child nodes, and leaf nodes) to identify the nodes / primitives traversed by the ray. The ray-BVH intersection circuit 3103 performs intersection tests of the rays to determine hit points on the primitives, and generates results in response to the hits. The traversal circuit 3102 and the intersection circuit 3103 can retrieve work from one or more call stacks 3121. Within the ray tracing acceleration circuit 3110, the call stack 3121 and associated ray tracing data 2902 can be stored in a local ray tracing cache (RTC) 3107 or other local storage device for efficient access by the traversal circuit 3102 and the intersection circuit 3103. A specific embodiment described below includes high bandwidth ray blocks (e.g., see Fig.32A ).

[0462] The ray tracing acceleration circuit 3110 may be a variant of the various traversal / intersection circuits described herein, including the ray-BVH traversal / intersection circuit 2005, the traversal circuit 2502 and the intersection circuit 2503, and the ray tracing core 1550. The ray tracing acceleration circuit 3110 may be used in place of the ray-BVH traversal / intersection circuit 2005, the traversal circuit 2502 and the intersection circuit 2503, and the ray tracing core 1550 or any other circuit / logic for processing a BVH stack and / or performing traversal / intersection. Therefore, the disclosure of any features described herein in combination with the ray-BVH traversal / intersection circuit 2005, the traversal circuit 2502 and the intersection circuit 2503, and the ray tracing core 1550 also discloses the corresponding combination with the ray tracing acceleration circuit 3110, but is not limited thereto.

[0463] Reference Fig.32A , one embodiment of the ray traversal circuit 3102 includes a first ray storage block and a second ray storage block, 3201 and 3202, respectively, wherein each block includes a plurality of entries for storing a corresponding plurality of incoming rays 3206 loaded from memory. A corresponding first stack and a second stack, 3203 and 3204, respectively, include selected BVH node data 3290-3291 read from memory and stored locally for processing. As described herein, in one embodiment, the stacks 3203-3204 are "short" stacks that include a limited number of entries (e.g., six entries in one embodiment) for storing BVH node data. Although shown separately from the ray blocks 3201-3202, the stacks 3203-3204 may also be maintained within the corresponding ray blocks 3201-3202. Alternatively, the stacks 3203-3204 may be stored in a separate local memory or cache.

[0464] When selecting the next ray and node to process, one embodiment of the traversal processing circuit 3210 alternates (e.g., in a ping-pong fashion) between the two blocks 3201-3202 and between the two stacks 3203-3204. For example, the traversal processing circuit 3210 may select a new ray / BVH node from an alternating ray block / stack on each clock cycle, thereby ensuring highly efficient operation. However, it should be noted that this particular arrangement is not necessary to comply with the underlying principles of the present invention.

[0465] In one embodiment, the ray distributor 3205 balances the entry of the incoming rays 3206 to the first memory block and the second memory block 3201-3202, respectively, based on the current relative values ​​of the set of block allocation counters 3220. In one embodiment, the block allocation counters 3220 maintain a count of the number of untraversed rays in each of the first memory block and the second memory block 3201-3202. For example, when the ray distributor 3205 adds a new ray to the first block 3201, the first block allocation counter can be incremented, and when a ray from the first block 3201 is processed, the first block allocation counter can be decremented. Similarly, when the ray distributor 3205 adds a new ray to the second block 3201, the second block allocation counter can be incremented, and when a ray from the second block 3201 is processed, the second block allocation counter can be decremented.

[0466] In one embodiment, ray distributor 3205 distributes the current ray to the tile associated with the smaller counter value. If the two counters are equal, ray distributor 3205 may select either tile, or may select a different tile than the last time the counters were equal. In one embodiment, each ray is stored in one entry in one of tiles 3201-3202, and each tile includes 32 entries for storing up to 32 rays. However, the underlying principles of the invention are not limited to these details.

[0467] Fig.32B The diagram shows four processes 3251-3254 that are executed in one embodiment to manage ray storage blocks 3201-3202 and stacks 3203-3204. In one embodiment, the four processes 3251-3254 are different implementations or configurations of a common set of program codes (sometimes referred to herein as "TraceRay"). The initial process 3251 can be executed to read the ray 3261 and perform a new top-down traversal of the BVH starting from the root node. The Alloc function modifies the control bits and initiates a corresponding read request for the ray tracing stack. Specifically, in order to allocate a new entry, Alloc sets the valid (VLD) bit and resets the eviction ready (Evict_Rdy) bit. In the block entry for the ray, the data present (DP) bit and the dirty bit are reset. The DP bit in the corresponding stack entry is set. For the corresponding Hitinfo (hit information), the DP bit is set and the dirty bit is reset. The DP bits associated with the node data and the shader record identifier (SRI) DP bits are reset.

[0468] An instance process 3252 performs a traversal within one of the nodes of the BVH (other than the root node) and reads rays and previously submitted hits 3262. In one embodiment, when one of the hit shaders identifies a hit between a ray and a primitive, then a commit process 3253 is executed to commit the results, thereby reading the ray, potential hits, and stack 3263. Alternatively, a continue process 3254 is executed to continue traversing the ray, thereby reading the ray, submitted hits, and stack 3264.

[0469] In various situations, such as when a shader is required to perform a sequence of operations, the traversal circuit 3102 must pause the traversal operation and save the current ray and associated BVH node. For example, if the opaque object is a hit or a procedural texture, the traversal circuit 3102 saves the stack 3203-3204 to memory and executes the required shader. Once the shader has completed processing the hit (or other data), the traversal circuit 3102 restores the state of the ray block 3201-3202 and the stack 3203-3204 from memory.

[0470] In one embodiment, the traversal / stack tracker 3248 continuously monitors the traversal and stack operations and stores the restart data in the tracking array 3249. For example, if the traversal circuit 3102 has traversed nodes N, N0, N1, N2, and N00 and generated results, the traversal / stack tracker 3248 will update the tracking array to indicate that the traversal of these nodes has been completed and / or indicate the next node to be processed from the stack. When the traversal circuit 3102 is restarted, it reads the restart data from the tracking array 3249 so that it can restart the traversal at the correct stage without re-traversing any of the BVH nodes (and wasting cycles). The restart data stored in the tracking array 3249 is sometimes referred to as a "restart route" or "RST".

[0471] like Fig.32B As indicated in , the various TraceRay processes 3251-3254 manage allocations into and out of the ray storage blocks 3201-3202 via one or more functions. As shown for the initial process 3251, the Alloc function sets the valid bit (VLD) in the storage block entry (indicating that the entry now contains a valid ray) and resets (Rst) the eviction ready flag (indicating that the ray data should not be evicted). The Ray function stores the ray in the selected entry and resets the data present (DP) bit (indicating that the ray data is stored in the entry) and the dirty bit (indicating that the data has not been modified). After reading the ray from the storage block, the Stack function sets the DP bit and retrieves the relevant BVH node from the stack (e.g., the root node in the case of the initial process 3251, and another node in the case of the instance process 3252). The HitInfo function resets the dirty bit and sets the DP bit for the initial function 3251, or resets the DP bit for all other functions. In one embodiment, Hitinfo generates data reflecting ray hits. The Node function resets the DP bit and the SRI (Shader Record Identifier) ​​DP, which is the DP for the shader record identifier. One embodiment performs a kernel start pointer (KSP) lookup to ensure that KSP is not equal to zero. If it is equal to zero, different treatment is implemented for non-opaque quads.

[0472] In one embodiment, once a ray entry has been allocated in one of the memory blocks 3201-3202, a fetch is performed to retrieve the node data (and potentially other data) from the stack associated with the ray. In one embodiment, a stack is maintained for each ray that includes a working set of data for the current node that the ray is traversing through.

[0473] When moving to the next level in the BVH (e.g., after determining that a ray intersects a parent node), the child nodes are sorted and pushed onto stacks 3203-3204. The child nodes are popped sequentially and processed individually to identify the child nodes traversed by the ray (traversal "hits"). In one embodiment, the stack is stored out to memory or local cache / storage whenever there is a switch between the RT acceleration circuit 3110 and the shader 2504, 2506, 2507, 3101, 3105.

[0474] When a leaf node including a quadrilateral or triangle (or other primitive type) is identified by the traversal circuit 3102, the leaf node passes this information to the intersection circuit 3103, which performs an intersection test on the quadrilateral or triangle, respectively. If the primitive is not a quadrilateral or triangle, in one implementation, the traversal circuit terminates the traversal and passes control back to the most recent hit shader 2507 (if a hit is detected) or the miss shader 2506 (if no hit is detected). In an implementation in which the intersection circuit 3103 is designed to perform intersections on various primitives other than quadrilaterals and triangles (e.g., lines, arcs, circles, etc.), the traversal circuit 3102 will then forward the leaf nodes for these primitives to the intersection circuit 3103. In one embodiment, when a hardware or software component generates a read request to the memory 3198 or cache, a 16-bit tag is used to provide information about the data type and the requester. For example, a two-bit code may specify whether the request is for a ray, stack data, hit data, node data from a BVH, or any other type of data. When the ray, stack, and hitinfo have been returned from memory, the ray is traversed through one or more BVH nodes and intersection tests are performed as described above.

[0475] At different stages of processing, one or more stacks 3203-3204 and rays 3206 are loaded from memory. For example, the initial process 3251 and / or the instance process 3252 may need to load a new BVH for traversal. In these cases, the stacks 3203-3204 may be initialized as the top nodes (or "root" nodes) of the BVH. For ray extensions 3254 within the BVH, the stacks 3203-3204 may be loaded from memory and extended. Once the stacks 3203-3204 have been prepared, the node data is obtained from the stacks (sometimes referred to as Proc_Node_Fetch operations hereinafter).

[0476] In one embodiment, node data is obtained by initiating parallel requests to two non-internal (NI) nodes and two internal nodes. Fig.33 One such embodiment is illustrated, where NI node priority selection logic (PRISEL) 3311 requests dual NI nodes: first NI node 3301 from block 0 and second NI node 3302 from block 1. At the same time, internal node PRISEL logic 3312 requests dual internal nodes: first node 3303 from block 0 and second node 3304 from block 1.

[0477] In one embodiment, the NI node priority selection logic (PRISEL) 3311 prioritizes one of the first NI node 3301 and the second NI node 3302, thereby storing the prioritized result in the ray tracing cache (RTC). Similarly, the internal node PRISEL logic 3312 requests the dual internal nodes and selects the prioritized result from the first internal node 3303 and the second internal node 3304.

[0478] If possible, each instance of the priority selection logic 3311-3312 prioritizes one of the non-interior BVH nodes 3301-3302 and one of the interior BVH nodes 3303-3304 from different blocks. In one embodiment, only one request is selected from each block (e.g., one of requests 3302 and 3304 and one of requests 3301 and 3303). The initiation of these requests can also reset the stack data present (DP) bit, as indicated, so that the entry is not retrieved in response to a node acquisition operation. In one embodiment, for an instance acquisition operation, the data present (DP) bit of the ray is reset when an instance request is sent, and the bit is finally set when the ray is transformed after the node acquisition.

[0479] In one embodiment, node_info is written at the start of a read, and for a read request, the address / label is calculated as follows:

[0480] i.rtt_rtc_rd_addr[47:6]=rt_ray.rt_ray_ctrl.root_node_ptr[47:6]+curr_stack.child_offset;(Note: the child offset on this node is always relative to the current BVH root node)

[0481] ii.rtt_rtc_rd_tag[6:0]={RTT_INST,rtt_alloc_entry[5:0]};

[0482] iii.node.node_info=curr_stack.node_info.

[0483] In one embodiment, the returned node data will have the DP bit set for both the node and the stack.

[0484] Based on the read tags, the following situations can be distinguished:

[0485] A. Internal Node : This will write to the node

[0486] B. Examples : This updates rt_ray.rt_ray_ctrl for the next level BVH (1) and writes the node structure.

[0487] i.root_node_ptr=node_return.StartNodePtr

[0488] ii.hitgrp_srbase_ptr=rt_ray_ctrl.hitgrp_srbase_ptr+rt_ray_ctrl.srstride*node_return.instancecontributiontohitgrpindex

[0489] iii.hitgrp_sr_stride=rt_ray_ctrl.srstride*rt_ray_ctrl.shade_indx_mult

[0490] iv.inst_leaf_ptr = rt_ray.rt_ray_ctrl.root_node_ptr + stack.current_node.child_offset → logical view only, fetch and store the node fetch address during the instance node fetch request itself

[0491] v.{miss_sr_ptr,shader_indx_mult,mask}={rt_ray[0].rt_ray_ctrl.miss_sr_ptr,rt_ray[0].rt_ray_ctrl.shader_indx_mult,rt_ray[0].rt_ray_ctrl.mask} retain BVH[0]

[0492] vi.flag[0] = rt_ray[0].rt_ray_ctrl.flag[0] | (~rt_ray[0].rt_ray_ctrl.flag[1] & Node_Return.flag[2]); → Preserve opacity via ray flags or via instance flags (only if ray flag is not force non-opaque)

[0493] vii.flag[1] = (rt_ray[0].rt_ray_ctrl.flag[1]) | (~rt_ray[0].rt_ray_ctrl.flag[0] & Node_Return.flag[3]); → preserve non-opaque via ray flags or via instance flags (only if ray flag is not forced-opaque)

[0494] viii.flag[3:2] = rt_ray[0].rt_ray_ctrl.flag[3:2]; → (accept first hit and end search or skip nearest hit shader) keep BVH[0]

[0495] ix.flag[5:4] = Node_Return.flag[0]? 2'd0:rt_ray[0].rt_ray_ctrl.flag[5:4]; → disable triangle culling via instance

[0496] x.flag[8:6] = rt_ray[0].rt_ray_ctrl.flag[8:6]; → (disable intersection shader, cull opaque or cull non-opaque) keep BVH[0]

[0497] xi.node.node_ctrl = Not needed for instances

[0498] xii.node.node_data={'0,node_rtn.obj2world_p,world2obj_vzyx};

[0499] C. quadrilateral : This will update the node as follows:

[0500] i.node.node_ctrl={node_rtn.leafDesc.last,node_rtn.leafDesc.PrimIndex1Delta[15:0],node_rtn.leafDesc.PrimIndex0[31:0],node_rtn.shader_indx};

[0501] ii.node.node_data={'0,Quad_mode,J[2:0],V[3:0]};→Quad_mode=node_rtn.leafDesc.PrimIndex1Delta[15:0]! ='0;

[0502] Based on the light mark, instance mark and geometry mark, Fig.55 The opaque / non-opaque handling table shown in indicates the resulting flag (opaque or non-opaque) to be used when obtaining node data. As indicated in the table, the ray flag always takes precedence. In addition, some of the states are mutually exclusive. In one embodiment, these states are handled in hardware with exclusive bit priority. In one implementation, if both cull_opaque and force_opaque are set, the associated geometry will be automatically culled.

[0503] opaque = rt_ray.rt_ray_ctrl.flag[0] | quad.flag[0]; (Note that the instance flag is already taken into account for rays stored per BVH level)

[0504] nopaque (non-opaque) = rt_ray.rt_ray_ctrl.flag[1]|~quad.flag[0].

[0505] Apparatus and method for level of detail transition for high quality ray tracing In graphics processing architecture, "level of detail" (LOD) may refer to the selection of mesh resolution based on variables such as distance from the camera. LOD technology is used to reduce memory consumption and improve graphics processing functions such as geometric aliasing in games. For example, when the mesh is far away from the user's current viewing angle, the details of a high-resolution mesh may not be needed.

[0506] In rasterization-based implementations, smooth transitions between LODs can be achieved using "stochastic LOD" techniques, such as described in Lloyd et al., Implementing Stochastic Levels of Detail with Microsoft DirectX Raytracing (June 15, 2020). Without these stochastic techniques, transitions between LODs can result in dispersive artifacts, where objects suddenly change in appearance when a new LOD is selected. With stochastic LOD, cross-dissolves between LOD levels are performed by random assignment of pixels to one of the LODs involved in the transition (e.g., a higher-resolution or lower-resolution LOD).

[0507] The above solution uses binary masks and binary comparison values ​​to implement eight transition steps for random LOD transitions when fading from a first LOD ("LOD0") to a second LOD ("LOD1"). In this implementation, an 8-bit ray mask and an 8-bit instance mask are logically "ANDed" to determine whether an instance needs to be traversed. These 8-bit masks and the associated bit-by-bit logic operations result in limited LOD transition capabilities. For example, when transitioning between LOD0 and LOD1 of an object (where LOD0 has a fractional value of 0.25 and LOD1 has a fractional value of 0.75 (based on camera distance)), the mask for the instance will be set to LOD0 to enable only 2 random bits (0.25 out of 8 bits). The instance mask for LOD1 will be set to the binary complement of the mask for LOD0, with 6 bits enabled. For any given ray, a random bit is selected in the ray mask to achieve a random selection of LOD0 (with a probability of 0.25) and LOD1 (with a probability of 0.75). However, since only one of the 8 bits is selected, there are only 8 intermediate steps in the transition between LOD0 and LOD1.

[0508] like Fig.34 As shown in , in one embodiment of the present invention, the LOD selector 3405 is provided with an N-bit comparison operation mask 3420, which is regarded as a binary value for determining the comparison operation to be performed. The selected comparison operation is used to compare with a reference to allow more transition LOD steps. In one embodiment, the comparison operation is selected from less than or equal to (less_equal) and greater than (greater), but the underlying principles of the present invention are not limited to these specific comparison operations. In one implementation, 8 bits (N=8) are used, where 7 of these bits define unsigned integer values ​​in the range [0..127], thereby enabling 128 transition steps for LOD crossfading, and 1 bit indicates the comparison operation (for example, if set to 0, a less_equal operation is performed, and if set to 1, a greater than operation is performed). In one embodiment, a light comparison mask 3421 can also be provided to the LOD selector 3405 as an additional light parameter in the range [0..127].

[0509] In one embodiment, the following code sequence highlights how the ray traversal reacts to this new comparison mask:

[0510]

[0511] In the above code sequence, the first IF statement tests whether the binary mask allows traversal into the current instance. If so, the second IF statement tests the comparison mode setting based on the values ​​of the instance comparison mask (e.g., comparison operation mask 3420) and the ray comparison mask 3421.

[0512] Returning to the LOD transition example above, for an instance of LOD0 with a fractional value of 0.25, the first 7 bits are set to a value of 31 (= int(0.25*127)), and the last bit is set to 0 (thereby indicating a less_equal operation). For an instance of LOD1 with a fractional value of 0.75, the first 7 bits are set to a value of 31 (= int((1.0-0.75)*127)), and the last bit is set to 1 (indicating a greater than operation). Therefore, for this implementation, if a uniformly distributed random number is generated in the range [0..127] as the ray comparison mask, there are up to 127 transition steps that can be selected by the LOD selector 3405 for transitioning between LOD0 and LOD1.

[0513] Although the above specific details are for explanation purposes, the underlying principles of the invention can be implemented with other details. For example, other comparison operators can be used instead of or in addition to less_equal and greater than. For example, comparison operators such as not_equal, equal, less, and greater_equal can also be used. One implementation includes a ray flag and an instance flag that disables the use of the ray mask by the "AND" operation and enables the use of these bits as a comparison mask.

[0514] Embodiments of the present invention include a combination of fixed-function acceleration circuits and general-purpose processing circuits to perform ray tracing. For example, certain operations associated with ray traversal and intersection testing of a bounding volume hierarchy (BVH) may be performed by fixed-function acceleration circuits, while multiple execution circuits execute various forms of ray tracing shaders (e.g., any hit shader, intersection shader, miss shader, etc.). One embodiment includes dual high-bandwidth storage blocks that include multiple entries for storing rays and corresponding dual stacks for storing BVH nodes. In this embodiment, the traversal circuit alternates between dual ray blocks and stacks to process rays at each clock cycle. In addition, one embodiment includes a priority selection circuit / logic that distinguishes between internal nodes, non-internal nodes, and primitives, and uses this information to intelligently prioritize the processing of BVH nodes and primitives defined by the BVH nodes.

[0515] Fig.35 An exemplary ray tracing engine 3500 is shown that performs the leaf node compression and decompression operations described herein. In one embodiment, the ray tracing engine 3500 includes circuitry of one or more of the ray tracing cores described above. Alternatively, the ray tracing engine 3500 may be implemented on a core of a CPU or other type of graphics core (e.g., a Gfx core, a tensor core, etc.).

[0516] In one embodiment, a ray generator 3502 generates rays that a traversal / intersection unit 3503 traces through a scene including a plurality of input primitives 3506. For example, an application such as a virtual reality game may generate a command stream from which input primitives 3506 are generated. The traversal / intersection unit 3503 traverses rays through a BVH 3505 generated by a BVH builder 3507 and identifies hit points where the rays intersect one or more of the primitives 3506. Although illustrated as a single unit, the traversal / intersection unit 3503 may include traversal units coupled to different intersection units. These units may be implemented in circuitry, software / commands executed by a GPU or CPU, or any combination thereof.

[0517] In one embodiment, the BVH processing circuit / logic 3504 includes a BVH builder 3507 that generates a BVH 3505 as described herein based on the spatial relationships between primitives 3506 in the scene. In addition, the BVH processing circuit / logic 3504 includes a BVH compressor 3509 and a BVH decompressor 3509 for compressing and decompressing leaf nodes, respectively, as described herein. For purposes of illustration, the following description will focus on a BVH with a width of 8 (BVH8).

[0518] like Fig.36 As shown in , one embodiment of a single 8-width BVH node 3600A contains 8 bounding boxes 3601-3608 and 8 (64-bit) child pointers / references 3610 pointing to the bounding box / leaf data 3601-3608. In one embodiment, the BVH compressor 3525 performs encoding, wherein the 8 child bounding boxes 3601A-3608A are expressed relative to the parent bounding box 3600A and are quantized into 8-bit uniform values, shown as bounding box leaf data 3601B-3608B. The quantized 8-width BVH, i.e., QBVH8 node 3600B, is encoded by the BVH compression 3625 using the start and range values ​​and is stored as two 3-dimensional single-precision vectors (2×12 bytes). The eight quantized child bounding boxes 3601B-3608B are stored as 2 times the eight bytes of the lower and upper bounds of the bounding box for each dimension (48 bytes in total). Note that this layout is different from existing implementations because the ranges are stored in full precision, which generally provides tighter bounds but requires more space. In one embodiment, the BVH decompressor 3526 decompresses the QBVH8 node 3600B as follows. The decompressed lower bound of dimension i can be obtained by QBVH8.start i +(byte-to-float)QBVH8.lower i *QBVH8.extend i To calculate, on CPU 2099, this requires 5 instructions for each dimension and box: 2 loads (start, expand), byte to integer load + upconvert, integer to float conversion, and a multiply-add. In one embodiment, decompression is done in parallel for all 8 quantized descendant bounding boxes 3601B-3608B using SIMD instructions, which adds an overhead of about 10 instructions to the ray node intersection test, making it at least twice as expensive as in the standard uncompressed node case. In one embodiment, these instructions are executed on the core of CPU 2099. Alternatively, a comparable set of instructions is executed by ray tracing core 2050.

[0519] Without pointers, a QBVH8 node requires 72 bytes, while an uncompressed BVH8 node requires 192 bytes, resulting in a reduction factor of 2.66. With 8 (64-bit) pointers, the reduction factor is reduced to 1.88, which makes it necessary to account for the storage cost of handling leaf pointers.

[0520] In one embodiment, when only the leaf layer of a BVH8 node is compressed into a QBVH8 node, all child pointers of the eight children 3601-3608 will only reference leaf metadata. In one implementation, this fact is exploited by storing all referenced metadata directly after the QBVH8 node 3600B itself, such as Fig.36 This allows the full 64-bit child pointer 3610 of the QBVH8 to be reduced to just an 8-bit offset 3622. In one embodiment, if the metadata is fixed size, the offsets 3622 are skipped entirely, as they can be calculated directly from the indices of the intersecting bounding boxes and the pointer to the QBVH8 node 3600B itself.

[0521] When using a top-down BVH8 builder, only compressing the BVH8 leaf level requires only slight modifications to the construction process. In one embodiment, these construction modifications are implemented in the BVH builder 3507. During the recursive construction phase, the BVH builder 3507 tracks whether the current number of primitives is below a certain threshold. In one implementation, N×M is the threshold, where N refers to the width of the BVH and M is the number of primitives in the BVH leaf. For BVH8 nodes and, for example, for four triangles per leaf, the threshold is 32. Therefore, for all subtrees with less than 32 primitives, the BVH processing circuit / logic 3504 will enter a special code path, where it will continue the splitting process based on the surface area heuristic (SAH), but create a single QBVH8 node 3600B. When the QBVH8 node 3600B is finally created, the BVH compressor 3509 then collects all referenced data and copies the primitive data to the right behind the QBVH8 node.

[0522] The actual BVH8 traversal performed by the ray tracing core 3650 or CPU 3699 is only slightly affected by leaf level compression. Essentially, the leaf level QBVH8 node 3600B is treated as an extended leaf type (e.g., it is marked as a leaf). This means that the conventional BVH8 top-down traversal continues until the QBVH node 3600B is reached. At this point, a single ray-QBVH node intersection is performed, and for all of its intersected children 3601B-3608B, the corresponding leaf pointers are rebuilt and conventional ray-primitive intersections are performed. Interestingly, sorting the intersecting children 3601B-3608B of the QBVH based on intersection distance may not provide any measurable benefit, because in most cases, only a single child is intersected by the ray anyway.

[0523] One embodiment of a leaf-level compression scheme even allows lossless compression of actual primitive leaf data by extracting common features. For example, triangles in a compressed-leaf BVH (CLBVH) node are likely to share vertices / vertex indices and attributes, such as the same objectID. By storing these shared attributes nearly once per CLBVH node and using small local byte-sized indexes in the primitives, memory consumption is further reduced. In one embodiment, the techniques for exploiting common spatially coherent geometric features within BVH leaves are also used for other more complex primitive types. Primitives such as hair fragments may share a common direction for each BVH leaf. In one embodiment, the BVH compressor 3509 implements a compression scheme that takes this common direction attribute into account to efficiently compress oriented bounding boxes (OBBs), which have been shown to be very useful for delimiting long diagonal primitive types.

[0524] The leaf-level compressed BVH described herein introduces BVH node quantization only at the lowest BVH level, and thus allows additional memory reduction optimizations while maintaining the traversal performance of the uncompressed BVH. Since only the BVH node at the lowest level is quantized, all of its children point to leaf data 3601B-3608B, which can be persistently stored in a block of memory or in one or more cache lines 3598.

[0525] This idea can also be applied to hierarchies using oriented bounding boxes (OBBs), which are typically used to speed up rendering of hair primitives. To illustrate a specific embodiment, the memory reduction for the typical case of a standard 8-width BVH over triangles will be evaluated.

[0526] The layout of 8-width BVH node 3600 is represented as the following core sequence:

[0527]

[0528] and requires 276 bytes of memory. The layout of a standard 8-width quantized node can be defined as:

[0529]

[0530]

[0531] and requires 136 bytes.

[0532] Because only quantized BVH nodes are used at the leaf level, all child pointers will actually point to leaf data 3601A-3608A. In one embodiment, the eight child pointers in quantized BVH node 3600B are removed by storing all leaf data 3601B-3608B pointed to by quantized node 3600B and its children in a single contiguous block of memory 3598. Saving the child pointers reduces the quantized node layout to:

[0533]

[0534] This requires only 72 bytes. Due to the contiguous layout in the memory / cache 3598, the child pointer of the i-th child can now be simply calculated by the following formula: childPtr(i) = addr(QBVH8NodeLeaf) + sizeof(QBVH8NodeLeaf) + i*sizeof(LeafDataType).

[0535] Since the nodes at the lowest level of the BVH take up more than half of the entire size of the BVH, the leaf-level-only compression described herein provides a reduction to 0.5+0.5*72 / 256=0.64 times the original size.

[0536] Furthermore, the overhead of having coarser boundaries and the cost of decompressing the quantized BVH nodes themselves only occurs at the BVH leaf level (as opposed to all levels when the entire BVH is quantized). Thus, the typically significant traversal and intersection overhead due to coarser boundaries (introduced by quantization) is largely avoided.

[0537] Another benefit of embodiments of the present invention is improved hardware and software prefetching efficiency. This stems from the fact that all leaf data is stored in relatively small contiguous memory blocks or (one or more) cache lines.

[0538] Since the geometry at the BVH leaf level is spatially consistent, all primitives referenced by the QBVH8NodeLeaf node are likely to share common attributes / features, such as objectID, one or more vertices, etc. Therefore, one embodiment of the present invention further reduces storage by removing duplication of primitive data. For example, primitives and associated data may be stored only once for each QBVH8NodeLeaf node, thereby further reducing memory consumption for leaf data.

[0539] The following describes efficient delimitation of hair primitives as an example of the significant memory reduction achieved by exploiting common geometric properties at the BVH leaf level. To accurately delimit hair primitives, which are long, thin structures oriented in space, a well-known approach is to compute oriented bounding boxes to tightly delimit the geometry. A coordinate space aligned to the hair direction is first computed. For example, the z-axis may be determined to point in the direction of the hair, while the x-axis and y-axis are perpendicular to the z-axis. Using this oriented space, standard AABBs can now be used to tightly delimit hair primitives. Intersecting a ray with such an oriented boundary requires first transforming the ray into oriented space, and then performing a standard ray / box intersection test.

[0540] The problem with this approach is its memory usage. The transformation into oriented space requires 9 floating point values, and storing the bounding box requires an additional 6 floating point values, resulting in a total of 60 bytes.

[0541] In one embodiment of the invention, the BVH compressor 3525 compresses the orientation space and bounding boxes for multiple hair primitives that are spatially close together. These compressed boundaries can then be stored in a compressed leaf level to tightly bound the hair primitives stored in the leaf. In one embodiment, the following method is used to compress the orientation boundaries. The orientation space can be represented by three normalized vectors v that are orthogonal to each other: x 、v y and v z Transforming a point p into this space is accomplished by projecting it onto these axes:

[0542] p x =dot(v x ,p)

[0543] p y =dot(v y ,p)

[0544] p z =dot(v z ,p)

[0545] Since the vector v x 、v y and v z are normalized so that their components are in the range [-1,1]. Therefore, these vectors are quantized using 8-bit signed fixed-point numbers instead of quantized using 8-bit signed integers and constant scaling. This generates the quantized v x ′、v y ′ and v z This approach reduces the memory required to encode the orientation space from 36 bytes (9 floating point values) to only 9 bytes (9 fixed point numbers, 1 byte each).

[0546] In one embodiment, the memory consumption of the orientation space is further reduced by taking advantage of the fact that all vectors are orthogonal to each other. Thus, only two vectors (e.g., p y ′ and p z ′), and p can be calculated x ′=cross(p′ y , p′ z ), further reducing the required storage to just six bytes.

[0547] What remains is to quantize the AABB in the quantized orientation space. The problem here is to project the point p onto the compressed coordinate axes of this space (e.g., by computing dot(v x ′,p)) produces values ​​with potentially very large range (since the value p is typically encoded as a floating point number). For this reason, it would be necessary to use floating point numbers to encode the boundaries, reducing the potential savings.

[0548] To solve this problem, one embodiment of the present invention first transforms the multiple hair primitives into a space where their coordinates are in the range [0, 1 / √3]. This can be done by determining the world-space axis-aligned bounding box b of the multiple hair primitives and using a transformation T that first translates b.lower to the left and then scales by 1 / max(b.size.x, b.size.ybsize.z) in each coordinate:

[0549]

[0550] One embodiment ensures that the geometry after this transformation remains in the range [0, 1 / √3], since the transformed point is then converted to the quantized vector p x ′、p y ′ or p z The projection onto ' remains in the range [-1,1]. This means that the AABB of the curved geometry can be quantized when using the T transform and then transformed into the quantized orientation space. In one embodiment, 8-bit signed fixed-point arithmetic is used. However, for precision reasons, 16-bit signed fixed-point numbers can be used (e.g., encoded using 16-bit signed integers and a constant scale). This reduces the memory requirements for encoding the axis-aligned bounding box from 24 bytes (6 floating point values) to only 12 bytes (6 words) plus the offset b.lower (3 floats) and the scale (1 float), which are shared for multiple hair primitives.

[0551] For example, with 8 hair primitives to define, this embodiment reduces memory consumption from 8*60 bytes = 480 bytes to only 8*(6+12)+3*4+4=160 bytes, which is a reduction of 3 times. By first transforming the light using the transform T, and then using the quantized v x ′、v y ′ and v z ' to project the ray, and intersect the ray with these quantized directional boundaries. Finally, the ray intersects with the quantized AABB.

[0552] An embodiment of the present invention improves the efficiency with which a user-written GPU program can cache and reuse data stored in a buffer or texture. The embodiment also provides a logical representation of resources for large programmatic computations that may or may not physically fit in GPU memory.

[0553] In one embodiment of the present invention, new slice resources are defined and managed by the GPU, referred to herein as GPU-managed slice resources or GPU-managed buffers. In one implementation, the buffer or other slice storage resource contains up to N fixed-size memory blocks. Different GPU architectures may support different maximum numbers of blocks (N).

[0554] In one embodiment, GPU-managed tile resources are used to efficiently share data between shaders - that is, one shader acts as a "producer" to one or more "consumer" shaders. For example, a producer shader can generate procedurally updated content that a consumer shader can use without involving interaction with the CPU. As another example, in a ray tracing implementation, various forms of skinning animations may need to be updated during traversal. One shader can skin a small portion of a mesh, storing the results in a tile resource without CPU intervention. When other rays trace the same portion, they can access the data locally from the tile resource without accessing main memory. Fig.37A An embodiment of an architecture for implementing GPU-managed slice resources 3731 is illustrated. A graphics processor 3721 includes a scheduler 3710 for scheduling shaders 3711A-3711B on a set of execution units 2001. The execution of the shaders requires access to the slice resources 3731 managed by a resource manager 3712. In the example provided below, one shader 3711A is designated as a "producer" that stores its results in the slice resources 3731, while another shader 3711B is a "consumer" that uses the results generated by the producer shader 3711A. Therefore, the producer shader 3711A requires access to write to the slice resources 3731, while the consumer shader 3711B requires read access to the slice resources 3731. However, it should be noted that the producer / consumer architecture is not necessary to comply with the underlying principles of the present invention.

[0555] In one implementation, tile resources 3731 include on-chip tile memory or tile buffers that store tile-sized blocks of data 0-(N-1). The "tile" size may vary based on the architecture of graphics processor 3721 and the configuration of the graphics processing pipeline. In one embodiment, the graphics processing pipeline is configured to use tile resources 3731 to perform tile-based deferred rendering, tile-based immediate mode rendering, and / or other forms of tile-based graphics processing.

[0556] In one embodiment, an execution unit (EU) 2001 or other processing unit requests a block using a hash value or other form of ID 3701 (e.g., a 64-bit hash in one embodiment). The resource manager 3712 determines whether the block exists within a slice resource 3731 that includes N fixed-size blocks. If no such block is found, the buffer manager 3710 evicts the least recently used (LRU) block or selects an unused block if it exists. The response 3702 identifies the allocated block that the buffer manager 3710 marked as "used" with a given hash value. In one implementation, a flag is also returned indicating that the block is new. The least recently used block that is replaced loses its old stored content. If the block already exists, a flag is returned indicating that the block already exists, but it is returned.

[0557] Although illustrated as a component within graphics processor 3721 , tile resources 3731 may be implemented within memory external to graphics processor 3721 , such as system memory or a system-level cache.

[0558] Certain classes of shaders 3711A-B executed on the GPU's EU 2001 are known a priori to require memory blocks. For example, these shaders may always be executed in a channel of a wave. In one embodiment, a scheduler 3710 that schedules the execution of these shaders 3711A-B constructs a 64-bit ID / hash from a system-generated value. For example, in the context of ray tracing, one embodiment uses InstanceID and GeometryID to construct a unique 64-bit hash. However, a variety of other system-generated variables may be used.

[0559] In this embodiment, the scheduler 3710 checks via the resource manager 3712 whether there is already a block of slice resources 3731 allocated for the 64-bit hash. If so, the shader 3711A-B is executed under the assumption that the block already contains cached data and that the data can be consumed by the shader, and the shader is scheduled on the EU 2001. As long as a shader that uses the cached data and the locked block of memory is executing, the resource manager 3712 locks the block so that it is not reused. When the shader is executed by one or more EU 2001, the shader uses the block ID 3701 to update the block in the slice resource 3731, and for certain operations, receives a response 3702 from the resource manager 3712.

[0560] In one embodiment, if the scheduler 3710 initially finds that there is no block with a given 64-bit hash, the resource manager 3712 locates an unused block or uses the least recently used block (or other block) that has been allocated and is not currently in use. If it cannot locate such a block, the resource manager 3712 can postpone the execution of the shader until such a block becomes available. When a block is available, the shard resource manager 3712 locks the shard resource block so that it is not reused as long as the shader is executing and scheduling the shader. A flag can be passed to the shader to indicate that the block is empty and the shader can use it to generate and store data. After writing data to the shard resource block, the shader can continue to execute as if the shard resource block and its data were already available.

[0561] Returning to the consumer / producer example above, if the requested hash is not valid in the pool, the producer shader 3711A may be scheduled to generate a novel block or slice of the procedural resource 3731. Such a requested hash may be generated by one or more consuming shaders 3711B, which the resource manager 3712 will block until their request is filled.

[0562] In one embodiment, the slice resource blocks are evicted to a solid state device 3715 or other high-speed storage medium. The SSD 3715 or other storage device may be locally integrated on the same substrate and / or card as the graphics processor 3721 and may be configured to save the slice resource blocks and other data during internal graphics processor 3721 context switching.

[0563] Fig.37B A method according to one embodiment is illustrated in . The method can be implemented within the context of the above architecture, but is not limited to any particular architecture.

[0564] At 3751, the scheduler evaluates the next shader to be scheduled for execution, and at 3752, determines a hash ID to be used to identify the tile resource block (e.g., using one or more of the techniques described herein). At 3753, the scheduler queries the tile resource manager using the hash ID.

[0565] If it is determined at 3754 that a block has been allocated for this hash ID, then at 3755 the shard resource manager locks the shard resource block, and at 3756 the shader uses the shard resource block during execution. The shard resource block can then be unlocked when the shader completes, unless it was locked using the hash ID of a consuming shader that will need the data after the current (producing) shader completes. In any case, the process returns to 3751 to schedule the next shader.

[0566] If at 3754, there is no slice resource block identified using the hash ID, the slice resource manager assigns the slice resource block to the hash ID and may assign a flag to the shader indicating that the shader can use the slice resource block. As mentioned, the slice resource manager can evict existing data from the slice resource block to assign the slice resource block to the current shader. At 3755, the slice resource block is locked, and at 3756, the shader uses the slice resource block during execution. The slice buffer 3731 managed by the GPU can be used in a variety of ways. For example, a SIMD wave of a channel wants to enter the same intersection shader box (described below) wrapped by an unbound thread dispatcher. Before running the intersection shader, the hardware requests a block from the buffer manager 3710.

[0567] The 64-bit hash can be generated in different ways. For example, in one embodiment, the 64-bit hash is the InstanceID of the current ray traversal instance combined with a frame counter. If the block is new, the hardware can start a user compute shader that runs within the channel of the wave, which then fills the block (e.g., using skinned triangles). If the block is old, the shader may not be started. The intersection shader is then executed and provided with a pointer to the block. The intersection shader can then perform ray / triangle intersection and / or can provide support for hardware instructions for ray / triangle intersection (as described herein). Alternatively, the block can be designed to contain only triangles. In this case, the hardware iterates over these triangles (without building a BVH on them) and can, for example, update the most recent hit shader or call into any hit shader. Various other use cases can utilize the GPU-managed sharding resources 3731 as described above.

[0568] Apparatus and method for efficient lazy BVH construction Complex dynamic scenes are challenging for real-time ray tracing implementation. Procedural surfaces, skinned animations, etc. require updates to the triangulation and acceleration structures in every frame, even before the first ray is fired.

[0569] Lazy construction evaluates scene elements "on demand", such as driven by ray traversal. Rendering of a frame starts with a coarse acceleration structure (such as the scene graph or hierarchy from the previous frame), and then incrementally builds new needed acceleration structures for objects hit by rays during the traversal. Non-visible objects can be effectively excluded from the construction process. However, these techniques are not easily implemented with current systems and APIs because the higher-level (i.e., per-object) programmability necessary to compute instance visibility is not supported.

[0570] One embodiment of the present invention supports multi-pass lazy build (MPLB) for real-time ray tracing, which addresses these issues using an extended programming model. It allows tracking the traversal of the instance hierarchy during each ray dispatch, and selectively builds a bottom level acceleration structure (BLAS) only for geometry that is potentially visible at render time. Similar to some adaptive sampling techniques, MPLB as described herein may require multiple ray dispatches on the same set of pixels to re-emit rays to previously unbuilt parts of the scene, but certain embodiments of the present invention include techniques for minimizing this overhead, such as assuming frame-to-frame consistency and rasterized primary visibility. These techniques can provide a significant reduction in build complexity compared to one-time builders, with only a slight increase in traversal cost on average.

[0571] Fig.38A One embodiment of an on-demand (or "lazy") builder 3807 for performing lazy build operations as described herein is illustrated. In addition, the embodiment includes traversal pause circuitry / logic 3820 for pausing ray traversals. The ray traversal pause circuitry / logic 3820 may be implemented in hardware, software, or any combination thereof. The ray stack storage 3805 stores the paused ray stack 3810 (as described in more detail herein) when traversal is paused. In addition, command scheduling on the GPU side initiates lazy build tasks and ray continuation on the execution unit 2001 without supervision by the CPU. Traversal atomicity is also used to reduce shader overhead.

[0572] Traversal stalls when missing BLAS nodes

[0573] In one implementation, a programming model with a traversal shader extension is used to programmatically mark missing instances (e.g., the bottom level acceleration structure of the BVH 3505) so that they can be identified and updated in a separate pass. The incomplete traversal is then either performed or the traversal is aborted.

[0574] In order to render the final pixel, it may be necessary to restart the main shader of the corresponding pixel, resulting in several repeated traversal and shader execution operations. In one embodiment, when traversal is paused, traversal pause logic 3820 backs up the entire ray context 3810 (ray stack, extension, etc.) to off-chip memory 3805. In one embodiment, the traversal pause is an inline function managed by the driver (e.g., SuspendTraversal()); however, the underlying principles of the present invention are not limited to this implementation. In addition, a new DispatchRay() variant on the host side (executed by CPU 3199) reschedules the paused ray stack from the ray context 3810 to continue traversal shader execution.

[0575] GPU-side command scheduling for build and dispatch

[0576] Another significant overhead of the current lazy build implementation is the constant requirement for CPU 3199 readback and conditional scheduling of BVH builder 3507 and ray dispatch on GPU 2505. To improve efficiency, in one implementation, BVH processing circuitry / logic 3504 runs BVH build asynchronously from ray traversal 3503. After the build task is complete, ray tracing engine 3500 performs ray dispatch to resume the suspended ray stack from ray context 3810.

[0577] Traversal atomicity to reduce shader traversal overhead

[0578] One problem with the current implementation is that if an instance is missing (not built), several rays may traverse it and mark it for the lazy builder 3807 to update it. A simple task that can be done with just one traversal shader call is repeated hundreds of times or more. The traversal shader is not resource intensive, but it has a significant overhead for starting up, performing input / output functions, and storing results.

[0579] In one embodiment of the invention, unbuilt instance leaves may be marked as "atomic" nodes. Atomic nodes may be traversed by only one ray at a time. Once a ray passes through an atomic node, the atomic node is locked, and the atomic node is unlocked at the end of the traversal shader execution. In one embodiment, the traversal shader sets the state of the node to "invalid", which prevents the ray from entering the node even after the lock is released. This allows the traversal hardware to skip nodes, or pause the traversal of a ray, without executing a new traversal shader.

[0580] In one embodiment, for atomic nodes, certain mutex / conditional semantics are used instead of the normal atomic semantics. For example, if the traversal circuit / logic 3503 traverses a ray to a proxy node, it attempts to lock the node. If this fails when the node is already locked, the traversal circuit / logic 3503 automatically performs a "suspendRay" without returning to EU 2001. If the lock is successfully performed, the traversal circuit / logic 3503 processes the proxy node.

[0581] Using traversal shaders to accelerate lazy construction of structures

[0582] One embodiment of the present invention is based on Fig.38B . As an overview, the on-demand builder 3807 builds acceleration structures on top of geometric instances 3860 that are determined to be potentially visible. Potentially visible instances 3860 are generated by pre-builder 3855 based on primary visibility data from G-buffer 3850 and visibility history data 3851 indicating visibility in a previous frame. Potentially visible instances 3860 can also be determined based on a visible bottom-level acceleration structure (BLAS) map 3875, which indicates the bottom-level nodes of the acceleration structure including visible primitives. In one embodiment, the visible BLAS map 3875 is continuously updated in response to traversal operations performed by traversal logic 3870, which may include dedicated traversal circuits and / or traversal shaders executed on an execution unit of a graphics processor. The on-demand builder 3807 generates those portions of the acceleration structure associated with potentially visible instances 3860. The ray generation shader 3878 selectively generates rays based on those portions of the acceleration structure that were traversed through by the traversal unit 3870. The traversal unit 3870 notifies the on-demand builder 3807 that it needs additional acceleration structure nodes for traversal, and updates the BLAS pixel mask 3877 used by the ray generation shader 3878 (e.g., the ray generation shader 3878 only generates rays for pixels that are not masked) and the visible BLAS map 3875.

[0583] Therefore, the on-demand builder 3807 selectively builds the bottom-level acceleration structure on potentially visible instances 3860, and the instance visibility is updated during the ray traversal 3870. Unlike previous implementations, embodiments of the present invention operate in multiple passes to avoid complex ray scheduling. This idea is similar to recent texture space shading methods, where visibility-driven texel marking is used to avoid redundant shading before the final rendering.

[0584] In operation, BLAS is first constructed for empty instances that were marked as potentially visible in the previous pass. In a second pass, the ray generation shader 3878 selectively re-emits rays to incomplete pixels, where the traversal shader is used to record more potentially visible empty instances or completed pixels. After each iteration, the number of incomplete pixels decreases until there are no rays left traversing empty instances.

[0585] One embodiment of the present invention uses the GPU rasterizer and ray tracing hardware to perform hybrid rendering together. This is because when creating the G-buffer 3850, the primary visibility of all instances in the scene is easily obtained. Therefore, the pre-builder 3855 in these embodiments utilizes hybrid rendering by efficiently building the initial acceleration structure using this data. Before the first iteration, the potentially visible instances 3860 are marked in this pre-build heuristic (as discussed below).

[0586] The following code sequence is an abstract High Level Shader Language (HLSL) that describes one embodiment of a traversal shader described using some intrinsics and user functions:

[0587]

[0588]

[0589] The SkipTraversal() inline function is defined to ignore the current instance and continue traversing in a higher level acceleration structure. As mentioned, the bottom level acceleration structure (BLAS) map 3875 is used to record instance visibility commonly used in acceleration structure builders and traversal shaders. Fig.38C As shown in , one embodiment of the visible BLAS map 3875 includes: a flag 3876 associated with each BLAS ID 3874 indicating the visibility of the BLAS referenced by the instance, and two flags indicating whether the BLAS has been built - Built_Full and Built_Empty. In addition, a Boolean flag trav_valid is added to the ray payload to keep track of the traversal state, which can be used to check whether the ray has encountered an empty instance so far.

[0590] In one embodiment, visibility in the traversal shader is updated conservatively because all traversed instances are potentially visible to the current ray. Therefore, the first task is to set the visibility flag to "true" for the corresponding BLAS of the current instance. The traversal shader also sets the visibility history (vis_history) flag to "true" to reuse the flag in the next frame (line 9 of the above code sequence). Next, the traversal destination is determined based on the state of the current instance (empty or full) and the ray state (i.e., the trav_valid value). Fig.38D As shown in , this is classified into three states 3890-3892.

[0591] For the empty instance 3890, the corresponding pixel mask is reset (line 15) so that the ray can be re-emitted in the next round. The current traversal is then invalidated by setting the trav_valid flag in the ray payload (line 16). Finally, the TLAS traversal is continued by calling SkipTraversal().

[0592] For the full instance and invalid traversal case 3891, the current instance has a built BLAS, but the ray has encountered an empty instance so far (i.e., trav_valid is "false"). Because the ray will eventually hit the current pixel again, the BLAS traversal can be skipped (line 20).

[0593] For full instances and valid traversals 3892, since the ray usually traverses the acceleration structure without an empty instance, the traversal shader gets the BLAS of the current instance and continues traversal. If the ray remains valid until the end of the traversal, the ray will usually call and execute the most recent hit shader or the miss shader.

[0594] Otherwise, those shaders return control without executing their code, and the current pass is completed, which avoids the overhead of hardware ray traversal and shader launches for secondary rays. In the next pass, rays are again fired only at pixels with "fake" masks, and valid traversals are attempted for those pixels.

[0595] For acceleration structure build operations, depending on the visibility flag of the visibility bitmask, the BLAS of the instance is built or an empty instance is created. Potentially visible instances usually construct the BLAS (BUILD_FULL), and invisible instances only compute the bounding box of the geometry and pack it in the leaf node of the TLAS (BUILD_EMPTY). Two other flags are also referenced, indicating whether a BUILD_FULL or BUILD_EMPTY operation has been performed for the current object in the previous pass. By checking these flags, repeated operations on the same object in different iterations of the build-traversal loop can be avoided.

[0596] Once the BLAS building process for the objects is completed, the final acceleration structure will be built by building TLAS on these BLAS. TLAS is only rebuilt in the first pass and trimmed in the remaining passes because the bounding boxes of all objects can already be built in the first pass.

[0597] As described above, one embodiment of the present invention performs multiple passes, which causes it to sometimes redundantly emit rays for the same pixel. This is because the current pass should make up for an invalid traversal in the previous pass. This may result in redundant hardware ray traversals and shader calls. However, one embodiment limits this overhead of traversal costs to only pixels corresponding to invalid traversals by applying a pixel mask.

[0598] In addition, a different technique is used to identify potentially visible BLAS (and build them) even before the first ray is traversed (e.g., by pre-builder 3855). Using G-buffer 3850, directly visible instances that may be traversed by the primary ray can be marked. In addition, a large amount of frame-to-frame consistency is assumed; therefore, BLAS for instances that were traversed in the previous frame are also pre-built. The combination of these two techniques greatly reduces the number of build-traverse iterations.

[0599] Apparatus and method for material removal masking

[0600] Existing ray tracing APIs use an 8-bit culling mask to skip ray traversal for certain geometry instances. This is used, for example, to prevent specific objects from casting shadows, or to hide objects from reflections. This feature allows different subsets of geometry to be represented in a single acceleration structure, rather than building a separate acceleration structure for each subset. The bit settings in the 8-bit mask can be used to balance traversal performance and resource overhead for maintaining multiple acceleration structures. For example, if a bit in the mask is set to 0, the corresponding instance can be ignored.

[0601] A rendering engine can associate multiple geometry instances with an asset, and each geometry instance can contain multiple materials. However, the current ray tracing API only allows culling masks to be specified at the granularity of an instance. This means that assets that have different culling masks for different materials cannot use standard culling. As a workaround, the current implementation uses an any-hit shader to ignore intersections, which is expensive and complex.

[0602] like Fig.39 As shown in , one embodiment of the present invention exposes these masking controls on a material-by-material basis. Specifically, one implementation includes an N-bit material-based culling mask 3901 to skip ray traversals for portions of geometric instances associated with certain materials. In one embodiment, an 8-bit material-based culling mask is used, but the underlying principles of the present invention are not limited to this implementation. In contrast to prior implementations, the material-based culling mask 3901 is exposed and can be utilized by the traversal circuit / logic 3503 for instance culling on a material-by-material and instance-by-instance basis.

[0603] In one particular implementation, an N-bit culling mask 3901 is stored within a hit group 3900, thereby providing fixed-function per-material culling and alleviating the need for expensive any-hit shader workarounds. A "hit group" 3900, as used herein, is an API object that contains a set of shaders for processing rays that hit a given object in a scene. The set of shaders may include, for example, a nearest hit shader, an any-hit shader, and (for procedural geometry) an intersection shader. In one implementation, a material-based culling mask 3901 is associated with a hit group 3900 as an additional piece of data.

[0604] To associate a cull mask 3901 with a hit group 3900, the cull mask 3901 may be stored within a 32-byte shader record that the API provides for use by the implementation (e.g., identified via a record ID as described herein). Note, however, that the underlying principles of the invention are not limited to any particular technique for associating a cull mask with a hit group.

[0605] In one embodiment, the traversal / intersection circuit 3503 directly culls potential hits based on the material-based culling mask 3901. For example, a mask value of 0 may indicate that instances with the corresponding material should be culled. Alternatively or additionally, this behavior may be emulated by injecting any hit shader within the driver.

[0606] Apparatus and method for box-box testing and accelerated collision detection for ray tracing

[0607] Figure 40A-40B Illustrated is a ray tracing architecture according to one embodiment of the present invention. Multiple execution units 4010 execute shaders and other program code associated with ray tracing operations. A "Traceray" function executed on one of the execution units (EUs) 4010 triggers a ray state initializer 4020 to initialize the state (e.g., stored in a stack 3121 in a memory buffer 4018 or other data structure in local or system memory 3198) required to trace the current ray (identified via a ray ID / descriptor) through a bounding volume hierarchy (BVH).

[0608] In one embodiment, if the Traceray function identifies a ray that was partially completed by a previous traversal operation, the state initializer 4020 uses the unique ray ID to load the associated ray tracing data 2902 and / or stack 3121 from one or more buffers 4018 in memory 3198. As mentioned, memory 3198 can be on-chip memory / local memory or cache and / or system-level memory devices.

[0609] As discussed with respect to other embodiments, a tracking array 3249 may be maintained to store traversal progress for each ray. If a ray has partially traversed a BVH, the state initializer 4020 may use the tracking array 3249 to determine the BVH level / node at which to restart.

[0610] Traversal and ray box test unit 4030 traverses rays through the BVH. When primitives have been identified within a leaf node of the BVH, instance / quad intersection tester 4040 tests the ray for intersection with the primitive (e.g., one or more primitive quads), retrieving the associated ray / shader record from a ray tracing cache 4060 (shown here as coupled to L1 cache 4070) integrated within the cache hierarchy of the graphics processor. Instance / quad intersection tester 4040 is sometimes referred to herein simply as an intersection unit (e.g., Fig.31 The intersection unit 3103 in it).

[0611] The ray / shader records are provided to the thread dispatcher 4050, which dispatches new threads to the execution units 4010 using, at least in part, the unbound thread dispatching techniques described herein. In one embodiment, the ray / box traversal unit 4030 includes the traversal / stack tracking logic 3248 described above, which tracks and stores the traversal progress for each ray within the tracking array 3249.

[0612] One class of problems in rendering can be mapped to testing boxes for collisions with other bounding volumes or boxes (e.g., due to overlap). Such box queries can be used to enumerate geometry within a query bounding box for a variety of applications. For example, box queries can be used to collect photons during photon mapping, enumerate all light sources that may affect a query point (or query region), and / or search for the closest surface point to a query point. In one embodiment, box queries operate on the same BVH structure as ray queries; thus, a user can trace rays through a scene and perform box queries on the same scene.

[0613] In one embodiment of the invention, for ray tracing hardware / software, box queries are handled similarly to ray queries, where the ray / box traversal unit 4030 uses box / box operations instead of ray / box operations to perform traversals. In one embodiment, the traversal unit 4030 can use the same set of features for box / box operations as for ray / box operations, including but not limited to motion blur, masks, flags, nearest hit shaders, any hit shaders, miss shaders, and traversal shaders. One embodiment of the invention adds a bit to each ray tracing message or instruction (e.g., TraceRay as described herein) to indicate that the message / instruction is associated with a BoxQuery operation. In one implementation, BoxQuery is enabled in both synchronous and asynchronous ray tracing modes (e.g., using standard dispatch operations and unbound thread dispatch operations, respectively).

[0614] In one embodiment, once set to BoxQuery mode via this bit, the ray tracing hardware / software (e.g., traversal unit 4030, instance / quad intersection tester 4040, etc.) interprets the data associated with the ray tracing message / instruction as box data (e.g., min / max values ​​in three dimensions). In one embodiment, the traversal acceleration structure is generated and maintained as previously described, but boxes are initialized instead of rays for each primary StackID.

[0615] In one embodiment, hardware instantiation is not performed for box queries. However, instancing can be simulated in software using traversal shaders. Therefore, when an instance node is reached during a box query, the hardware can treat the instance node as a procedural node. Since the headers of the two structures are the same, this means that the hardware will call the shader stored in the header of the instance node, which can then continue the point query inside the instance.

[0616] In one embodiment, a ray flag is set to indicate that the instance / quad intersection tester 4040 will accept the first hit and end the search (e.g., ACCEPT_FIRST_HIT_AND_END_SEARCH flag). When this ray flag is not set, the children of the intersection are entered from front to back based on their distance from the query box, similar to a ray query. This traversal order significantly improves performance when searching for the closest geometry to a point, as is the case with ray queries.

[0617] One embodiment of the present invention uses any hit shader to filter out false positive hits. For example, while the hardware may not be able to perform accurate box / triangle tests at the leaf level, it will conservatively report all triangles that hit a leaf node. In addition, when the search box is reduced by any hit shader, the hardware can return the primitive of the popped leaf node as a hit even though the leaf node box may no longer overlap with the reduced query box.

[0618] like Fig.40A As indicated in , a box query may be issued by an execution unit (EU) 4010, which sends a message / command (i.e., Traceray) t...

Claims

1. A device comprising: a sampling weight generator for determining a plurality of sampling weights associated with a corresponding plurality of input primitives, the sampling weight generator for determining each sampling weight based on a surface area or a diagonal of a bounding box of the corresponding input primitive and a plurality of distance values ​​corresponding to distances between the input primitive and a corresponding plurality of adjacent input primitives; a sampler for identifying a representative subset of input primitives based at least in part on the plurality of sampling weights; a bounding volume hierarchy (BVH) builder hardware logic for constructing an approximate BVH based on the representative subset of input primitives; hardware logic for inserting input primitives not in the representative subset into leaves of the approximate BVH; and The BVH builder, or a different BVH builder, is used to construct a final BVH based on primitives inserted into leaves of the approximate BVH.

2. The apparatus of claim 1, wherein the representative subset is selected from a portion of graphics data loaded into memory, the portion of graphics data comprising a smaller portion than would be desired to fully construct the BVH.

3. An apparatus according to claim 1 or 2, wherein the primitive sampler includes an importance sampler for performing random importance sampling to identify the representative subset of input primitives, and wherein the BVH builder or a different BVH builder is used to operate in parallel on leaves after primitives are inserted to construct the final BVH.

4. The device according to any one of claims 1 to 3, further comprising: The compression hardware logic is used to perform compression and / or quantization on the nodes of the final BVH to generate a compressed final BVH.

5. The apparatus of claim 2, wherein an importance sampler is configured to bias selection of the subset of input primitives toward primitives having greater influence on the approximated BVH.

6. The apparatus of claim 5, wherein the importance sampler is configured to bias selection of relatively large primitives over relatively small primitives.

7. The apparatus of claim 6, wherein the importance sampler is configured to implement a cumulative density function (CDF) to identify the subset of input primitives.

8. The device according to any one of claims 1 to 7, further comprising: Traversal hardware logic for traversing the light rays through the final BVH; as well as Intersection hardware logic that identifies intersections between a ray and one or more of the input primitives.

9. A method comprising: determining each of a plurality of sampling weights associated with a corresponding plurality of input primitives based on a surface area or a diagonal of a bounding box of the corresponding input primitive and a plurality of distance values ​​corresponding to distances between the input primitive and a corresponding plurality of adjacent input primitives; sampling the input primitives to identify a representative subset of the input primitives based at least in part on the plurality of sampling weights; constructing an approximate bounding volume hierarchy (BVH) based on the representative subset of input primitives; inserting input primitives not in the representative subset into leaves of the approximate BVH; and A final BVH is constructed based on the primitives inserted into the leaves of the approximate BVH.

10. The method of claim 9, wherein the representative subset is selected from a portion of graphics data loaded into memory, the portion of graphics data comprising a smaller portion than would be desired to fully construct the BVH.

11. The method of claim 9 or 10, wherein sampling input primitives further comprises performing random importance sampling to identify the representative subset of input primitives, and wherein constructing the final BVH further comprises operating on leaves in parallel after primitives are inserted.

12. The method according to any one of claims 9 to 11, further comprising: Compression and / or quantization are performed on the nodes of the final BVH to generate a compressed final BVH.

13. The method of claim 10, wherein the selection of the subset of input primitives is biased toward primitives having a greater influence on the approximated BVH. The method of claim 13 , wherein relatively large primitives are selected in preference to relatively small primitives.

15. The method of claim 14, wherein a cumulative density function (CDF) is implemented to identify the subset of input primitives.

16. The method according to any one of claims 9 to 15, further comprising: traversing the final BVH; as well as Identifies intersections between a ray and one or more of the input primitives.

17. A machine-readable medium having program code stored thereon, the program code, when executed by a machine, causing the machine to: determining each of a plurality of sampling weights associated with a corresponding plurality of input primitives based on a surface area or a diagonal of a bounding box of the corresponding input primitive and a plurality of distance values ​​corresponding to distances between the input primitive and a corresponding plurality of adjacent input primitives; sampling the input primitives to identify a representative subset of the input primitives based at least in part on the plurality of sampling weights; constructing an approximate bounding volume hierarchy (BVH) based on the representative subset of input primitives; inserting input primitives not in the representative subset into leaves of the approximate BVH; and A final BVH is constructed based on the primitives inserted into the leaves of the approximate BVH.

18. The machine-readable medium of claim 17, wherein the representative subset is selected from a portion of graphics data loaded into memory, the portion of graphics data comprising a smaller portion than desired to fully construct the BVH.

19. The machine-readable medium of claim 17 or 18, wherein sampling input primitives further comprises performing random importance sampling to identify the representative subset of input primitives, and wherein constructing the final BVH further comprises operating on leaves in parallel after primitives are inserted.

20. The machine-readable medium of any one of claims 17 to 19, further comprising program code for causing the machine to: Compression and / or quantization are performed on the nodes of the final BVH to generate a compressed final BVH.

21. The machine-readable medium of claim 18, the selection of the subset of input primitives being biased toward primitives having a greater influence on the approximated BVH.

22. The machine-readable medium of claim 21, wherein relatively larger primitives are selected in preference to relatively smaller primitives.

23. The machine-readable medium of claim 22, wherein a cumulative density function (CDF) is implemented to identify the subset of input primitives.

24. The machine-readable medium of any one of claims 17 to 23, further comprising program code for causing the machine to: traversing the final BVH with rays; and Identifies intersections between a ray and one or more of the input primitives.

Citation Information

Cited By

  • Multi-light-source direct illumination rendering method and system based on multiple control variables

    CN119762660A

  • Node updating method and device in three-dimensional game, electronic equipment and storage medium

    CN121534389A