Techniques for performing accelerated point sampling in the texture processing pipeline

By optimizing texture memory queries in multiple stages in the texture processing pipeline, the problem of inefficient texture loading and point sampling operations is solved, and the resource utilization and performance of texture processing hardware are improved.

CN113835753BActive Publication Date: 2024-09-20NVIDIA CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110690974.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-06-23
Filing Date
2021-06-22
Publication Date
2024-09-20
Estimated Expiration
2041-06-22

AI Technical Summary

Technical Problem

Existing texture processing hardware has low efficiency and performance during texture loading and point sampling operations, and does not fully utilize memory access capabilities, resulting in ineffective utilization of the resources of the texture processing hardware.

Method used

Introduce multiple stages into the texture processing pipeline to determine and optimize the acceleration strategy for texture memory queries. The first and second stages are determined through the TEXIO and TEXIN units respectively. Based on the opcode and status information of the texture instructions, split and re- Configure texture instructions to increase execution rates and ensure that texture operations and loads use memory access capabilities more efficiently.

Benefits of technology

Improved memory access capability utilization during texture loading and simple texture operations, improving the efficiency and performance of texture processing hardware, allowing more texture loading and operations to effectively utilize hardware resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113835753B_ABST
    Figure CN113835753B_ABST
Patent Text Reader

Abstract

The present invention discloses a technique for performing accelerated point sampling in a texture processing pipeline. The texture processing pipeline in a graphics processing unit generates surface appearances for objects in a computer-generated scene. At multiple stages within the texture processing pipeline, the texture processing pipeline determines whether texture operations and texture loads can be processed at an accelerated rate. At each stage, including a decision point, the texture processing pipeline assumes that the current texture operation or texture load can be accelerated unless specific, known information indicates that the texture operation or texture load cannot be accelerated. As a result, the texture processing pipeline increases the number of texture operations and texture loads that are accelerated relative to the number of texture operations and texture loads that are not accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Various embodiments relate generally to parallel processing architectures and, more particularly, to techniques for performing accelerated point sampling in a texture processing pipeline. Background Art

[0002] Graphics processing units (GPUs) are used to generate three-dimensional (3D) and two-dimensional (2D) graphics objects for a variety of applications, including feature films, computer games, virtual reality (VR) and augmented reality (AR) experiences, mechanical design, etc. Modern GPUs include texture processing hardware to generate surface appearances (referred to herein as "surface textures") for 3D objects in 3D graphics scenes. The texture processing hardware applies surface appearances to 3D objects by "wrapping" the appropriate surface textures around the 3D objects. The process of generating and applying surface textures to 3D objects can provide a highly realistic appearance to those 3D objects in a 3D graphics scene.

[0003] The texture processing hardware is configured to execute various texture-related instructions, including texture operations and texture loads. The texture processing hardware generates access to texture information by generating memory references (referred to herein as "queries") to texture memory. The texture processing hardware retrieves surface texture information from texture memory in varying circumstances, such as when rendering an object surface in a 3D graphics scene for display on a display device, when rendering a 2D graphics scene, or during a computing operation.

[0004] Surface texture information includes texture elements (referred to herein as "texels") used to texturize or color the surfaces of objects in a 3D graphics scene. Texture processing hardware and associated texture caches are optimized for efficient, high-throughput read-only access to support high demands for texture information during graphics rendering, with little or no support for write operations. In addition, the texture processing hardware includes dedicated functional units for performing various texture operations, such as level of detail (LOD) calculations, texture sampling, and texture filtering.

[0005] Typically, texture operations involve querying multiple texture pixels around a particular point of interest in 3D space, and then performing various filtering and interpolation operations to determine the final color of that point of interest. In contrast, texture loads typically query a single texture pixel and return it directly to the user application for further processing. Because filtering and interpolation operations typically involve querying four or more texture pixels per processing thread, texture processing hardware is typically constructed to accommodate the generation of multiple queries per thread. For example, texture processing hardware can be constructed to accommodate up to four texture memory queries in a single memory cycle. In this way, the texture processing hardware is able to query and receive most or all of the required texture information in one memory cycle.

[0006] A disadvantage of this method for querying texture memory is that when the texture processing hardware is used for texture loading, only one of the four possible texture memory queries is executed in a single memory cycle. As a result, only one quarter of the memory access capability of the texture processing hardware is utilized during texture loading. In addition, certain texture operations (referred to herein as point sampled texture operations) require only one or two texture memory queries to be performed in a given memory cycle, thus utilizing only one quarter to one half of the memory access capability of the texture processing hardware. This underutilization of the texture processing hardware can lead to reduced efficiency and performance when the GPU performs texture loading and point sampled texture operations.

[0007] As previously stated, what is needed in the art is a more efficient technique for querying texture information in a graphics processing unit. Summary of the invention

[0008] Various embodiments of the present disclosure set forth a computer-implemented method for accessing texture memory in a graphics processing unit. The method includes, at a first stage in a texture processing pipeline, generating a first determination that a texture memory query is eligible for acceleration within the texture processing pipeline. The method also includes, based on the first determination, causing the texture memory query to proceed to a second stage in the texture processing pipeline. The method also includes, at the second stage in the texture processing pipeline, generating a second determination that the texture memory query is eligible for acceleration within the texture processing pipeline. The method also includes processing the texture memory query within the texture processing pipeline based on at least one of the first determination and the second determination.

[0009] Other embodiments include, but are not limited to, systems that implement one or more aspects of the disclosed technology, and one or more computer-readable media including instructions for performing one or more aspects of the disclosed technology.

[0010] At least one technical advantage of the disclosed technology over the prior art is that, with the disclosed technology, a greater percentage of texture memory access capabilities are used during texture loading and during simple texture operations. As a result, the efficiency and performance of the texture processing hardware are improved during texture loading and texture operations over prior art approaches. Another technical advantage of the disclosed technology is that the texture processing hardware includes multiple stages for determining whether the memory access capabilities of the texture processing hardware can be used more efficiently. As a result, a greater number of texture loads and texture operations can utilize the disclosed technology over approaches that make this determination only at a single stage of the texture processing hardware. These advantages represent one or more technical improvements over prior art approaches. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order that the manner in which the above-described features of various embodiments may be understood in detail, the inventive concept briefly outlined above may be described in more detail by reference to various embodiments, some of which are shown in the accompanying drawings. However, it should be noted that the drawings illustrate only typical embodiments of the inventive concept and are therefore not to be construed as limiting the scope in any way, and that there are other equally effective embodiments.

[0012] Figure 1 is a block diagram of a computer system configured to implement one or more aspects of various embodiments;

[0013] Figure 2 According to various embodiments, including Figure 1 A block diagram of a parallel processing unit (PPU) in a parallel processing subsystem of FIG.

[0014] Figure 3A According to various embodiments, including Figure 2 A block diagram of a general processing cluster in a parallel processing unit of;

[0015] Figure 3B According to various embodiments, Figure 2 A conceptual diagram of a graphics processing pipeline implemented within a parallel processing unit of FIG.

[0016] Figure 4 According to various embodiments, it can be configured Figure 3A A conceptual diagram of a texture processing pipeline implemented by a texture unit within a general processing cluster of FIG.

[0017] Figure 5 is a flow chart of method steps for performing memory access operations in a texture processing pipeline, according to various embodiments. DETAILED DESCRIPTION

[0018] In the following description, numerous specific details are set forth to provide a more thorough understanding of various embodiments. However, it will be apparent to one skilled in the art that the inventive concept may be practiced without one or more of these specific details.

[0019] System Overview

[0020] Figure 1 1 is a block diagram of a computer system 100 configured to implement one or more aspects of various embodiments. As shown, computer system 100 includes, but is not limited to, a central processing unit (CPU) 102 and a system memory 104 coupled to a parallel processing subsystem 112 via a memory bridge 105 and a communication path 113. Memory bridge 105 is also coupled to an I / O (input / output) bridge 107 via a communication path 106, and I / O bridge 107 is in turn coupled to a switch 116.

[0021] In operation, I / O bridge 107 is configured to receive user input information from input device 108, such as a keyboard or mouse, and forward the input information to CPU 102 for processing via communication path 106 and memory bridge 105. Switch 116 is configured to provide connections between I / O bridge 107 and other components of computer system 100 (e.g., network adapter 118 and various add-in cards 120 and 121).

[0022] As also shown, the I / O bridge 107 is coupled to a system disk 114, which can be configured to store content and applications and data for use by the CPU 102 and the parallel processing subsystem 112. Typically, the system disk 114 provides non-volatile storage for applications and data, and may include a fixed or removable hard drive, a flash memory device, and a CD-ROM (Compact Disc Read Only Memory), DVD-ROM (Digital Versatile Disc-ROM), Blu-ray, HD-DVD (High Definition DVD), or other magnetic, optical, or solid-state memory device. Finally, although not explicitly shown, other components such as a universal serial bus or other port connection, an optical drive, a digital versatile optical drive, a film recording device, etc. may also be connected to the I / O bridge 107.

[0023] In various embodiments, memory bridge 105 may be a northbridge chip, and I / O bridge 107 may be a southbridge chip. Additionally, communication paths 106 and 113, as well as other communication paths within computer system 100, may be implemented using any technically suitable protocol, including but not limited to AGP (Accelerated Graphics Port), HyperTransport, or any other bus or point-to-point communication protocol known in the art.

[0024] In some embodiments, parallel processing subsystem 112 includes a graphics subsystem that transmits pixels to display device 110, which can be any conventional cathode ray tube, liquid crystal display, light emitting diode display, etc. In such embodiments, parallel processing subsystem 112 includes circuits optimized for graphics and video processing, including, for example, video output circuits. Figure 2 As described in more detail in , such circuitry may be included in one or more parallel processing units (PPUs) included within parallel processing subsystem 112. In other embodiments, parallel processing subsystem 112 includes circuitry optimized for general purpose and / or computational processing. Furthermore, such circuitry may be included in one or more PPUs included in parallel processing subsystem 112 that are configured to perform such general purpose and / or computational operations. In other embodiments, one or more PPUs included in parallel processing subsystem 112 may be configured to perform graphics processing operations, general purpose processing operations, and computational processing operations. System memory 104 includes at least one device driver 103 that is configured to manage processing operations of one or more PPUs within parallel processing subsystem 112.

[0025] In various embodiments, the parallel processing subsystem 112 may be coupled to Figure 1 One or more other elements of the CPU 102 may be integrated together to form a single system. For example, the parallel processing subsystem 112 may be integrated with the CPU 102 and other connecting circuits on a single chip to form a system on a chip (SoC).

[0026] It should be understood that the system shown herein is exemplary and that various changes and modifications are possible. The connection topology, including the number and arrangement of bridges, the number of CPUs 102, and the number of parallel processing subsystems 112, can be modified as needed. For example, in some embodiments, the system memory 104 can be directly connected to the CPU 102, rather than being connected to the CPU 102 through the memory bridge 105, and other devices will communicate with the system memory 104 via the memory bridge 105 and the CPU 102. In other alternative topologies, the parallel processing subsystem 112 can be connected to the I / O bridge 107 or directly to the CPU 102, rather than being connected to the memory bridge 105. In other embodiments, the I / O bridge 107 and the memory bridge 105 can be integrated into a single chip, rather than existing as one or more discrete devices. Finally, in some embodiments, there may be no Figure 1 For example, the switch 116 may be omitted, and the network adapter 118 and add-in cards 120 , 121 would be connected directly to the I / O bridge 107 .

[0027] Figure 2According to various embodiments, including Figure 1 1. Although Figure 2 One PPU 202 is depicted, but as described above, the parallel processing subsystem 112 may include any number of PPUs 202. As shown, the PPU 202 is coupled to a local parallel processing (PP) memory 204. The PPU 202 and the PP memory 204 may be implemented using one or more integrated circuit devices (e.g., a programmable processor, an application specific integrated circuit (ASIC), or a memory device) or in any other technically feasible manner.

[0028] In some embodiments, PPU 202 includes a graphics processing unit (GPU) that can be configured to implement a graphics rendering pipeline to perform various operations related to generating pixel data based on graphics data provided by CPU 102 and / or system memory 104. When processing graphics data, PP memory 204 can be used as a graphics memory that stores one or more conventional frame buffers and, if necessary, one or more other rendering targets. Among them, PP memory 204 can be used to store and update pixel data and transmit the final pixel data or display frame to display device 110 for display. In some embodiments, PPU 202 can also be configured for general processing and computing operations.

[0029] In operation, CPU 102 is the main processor of computer system 100, which is used to control and coordinate the operation of other system components. In particular, CPU 102 issues commands that control the operation of PPU 202. In some embodiments, CPU 102 writes a command stream for PPU 202 into a data structure (in Figure 1 or Figure 2 The push buffer 202 may be a data structure that is not explicitly shown in the figure and may be located in the system memory 104, the PP memory 204, or another storage location accessible to both the CPU 102 and the PPU 202. A pointer to the data structure is written to a push buffer to start processing the command stream in the data structure. The PPU 202 reads the command stream from the push buffer and then executes the commands asynchronously with respect to the operation of the CPU 102. In an embodiment where multiple push buffers are generated, an execution priority may be specified by the application via the device driver 103 for each push buffer to control the scheduling of different push buffers.

[0030] As also shown, the PPU 202 includes an I / O (input / output) unit 205 that communicates with the rest of the computer system 100 via the communication path 113 and the memory bridge 105. The I / O unit 205 generates packets (or other signals) for transmission on the communication path 113, and also receives all incoming packets (or other signals) from the communication path 113, directing the incoming packets to the appropriate components of the PPU 202. For example, commands related to processing tasks may be directed to the host interface 206, while commands related to memory operations (e.g., reading from or writing to the PP memory 204) may be directed to the crossbar unit 210. The host interface 206 reads each push buffer and sends the command stream stored in the push buffer to the front end 212.

[0031] As above combined Figure 1 As described above, the connection of PPU 202 to the rest of computer system 100 may vary. In some embodiments, parallel processing subsystem 112 including at least one PPU 202 is implemented as an add-in card that can be inserted into an expansion slot of computer system 100. In other embodiments, PPU 202 may be integrated on a single chip along with a bus bridge such as memory bridge 105 or I / O bridge 107. Likewise, in other embodiments, some or all elements of PPU 202 may be included in a single integrated circuit or system on a chip (SoC) along with CPU 102.

[0032] In operation, the front end 212 sends the processing tasks received from the host interface 206 to the work distribution unit (not shown) within the task / work unit 207. The work distribution unit receives a pointer to the processing task encoded as task metadata (TMD) and stored in the memory. The pointer to the TMD is included in the command stream, which is stored as a push buffer and received by the front end unit 212 from the host interface 206. The processing task that can be encoded as a TMD includes an index associated with the data to be processed and a state parameter and command that defines how the data will be processed. For example, the state parameter and command can define the program to be executed on the data. The task / work unit 207 receives the task from the front end 212 and ensures that the GPC 208 is configured to a valid state before starting the processing task specified by each TMD. A priority can be specified for each TMD used to schedule the execution of the processing task. The processing task can also be received from the processing cluster array 230. Optionally, the TMD can include a parameter that controls whether the TMD is added to the beginning or end of the processing task list (or added to the pointer list of the processing task), thereby providing another level of control over the execution priority.

[0033] PPU 202 advantageously implements a highly parallel processing architecture based on a processing cluster array 230 that includes a set of C general processing clusters (GPCs) 208, where C ≥ 1. Each GPC 208 is capable of executing a large number (e.g., hundreds or thousands) of threads simultaneously, where each thread is an instance of a program. In various applications, different GPCs 208 may be assigned to process different types of programs or to perform different types of calculations. The assignment of GPCs 208 may vary depending on the workload generated by each type of program or calculation.

[0034] The memory interface 214 includes a set of D partition units 215, where D ≥ 1. Each partition unit 215 is coupled to one or more dynamic random access memories (DRAMs) 220 residing in the PPM memory 204. In one embodiment, the number of partition units 215 is equal to the number of DRAMs 220, and each partition unit 215 is coupled to a different DRAM 220. In other embodiments, the number of partition units 215 may be different from the number of DRAMs 220. It will be appreciated by those skilled in the art that the DRAMs 220 may be replaced with any other technically suitable memory device. In operation, various rendering targets, such as texture maps and frame buffers, may be stored in the DRAMs 220, allowing the partition units 215 to write portions of each rendering target in parallel to efficiently use the available bandwidth of the PP memory 204.

[0035] A given GPC 208 can process data to be written to any DRAM 220 in PP memory 204. A crossbar unit 210 is configured to route the output of each GPC 208 to the input of any partition unit 215 or to any other GPC 208 for further processing. The GPCs 208 communicate with a memory interface 214 via the crossbar unit 210 to read from or write to the various DRAMs 220. In one embodiment, in addition to the connection to PP memory 204 via the memory interface 214, the crossbar unit 210 also has a connection to the I / O unit 205, thereby enabling processing cores within different GPCs 208 to communicate with the system memory 104 or other memory that is not local to the PPU 202. In Figure 2 In the embodiment of the present invention, the crossbar switch unit 210 is directly connected to the I / O unit 205. In various embodiments, the crossbar switch unit 210 can use virtual channels to separate the traffic flow between the GPC 208 and the partition unit 215.

[0036] Likewise, the GPCs 208 may be programmed to perform processing tasks associated with a wide variety of applications, including, but not limited to, linear and nonlinear data transformations, filtering of video data and / or audio data, modeling operations (e.g., applying physical laws to determine the position, velocity, and other properties of an object), image rendering operations (e.g., tessellation shader, vertex shader, geometry shader, and / or pixel / fragment shader programs), general computational operations, etc. In operation, the PPU 202 is configured to transfer data from the system memory 104 and / or the PP memory 204 to one or more on-chip memory units, process the data, and write the resulting data back to the system memory 104 and / or the PP memory 204. The resulting data may then be accessed by other system components, including the CPU 102, another PPU 202 in the parallel processing subsystem 112, or another parallel processing subsystem 112 in the computer system 100.

[0037] As described above, any number of PPUs 202 may be included in the parallel processing subsystem 112. For example, multiple PPUs 202 may be provided on a single add-in card, or multiple add-in cards may be connected to the communication path 113, or one or more of the PPUs 202 may be integrated into a bridge chip. The PPUs 202 in a multi-PPU system may be the same or different from each other. For example, different PPUs 202 may have different numbers of processing cores and / or different numbers of PP memories 204. In implementations where there are multiple PPUs 202, these PPUs may run in parallel to process data at a higher throughput than a single PPU 202 may. Systems containing one or more PPUs 202 may be implemented in a variety of configurations and form factors, including but not limited to desktops, laptops, handheld personal computers or other handheld devices, servers, workstations, game consoles, embedded systems, and the like.

[0038] Figure 3A According to various embodiments, including Figure 2208 in parallel processing unit 202. In operation, GPC 208 can be configured to execute a large number of threads in parallel to perform graphics operations, general processing operations and / or computing operations. As used herein, "thread" refers to an instance of a specific program executed on a specific input data set. In some embodiments, single instruction, multiple data (SIMD) instruction issuance technology is used to support the parallel execution of a large number of threads without providing multiple independent instruction units. In other embodiments, a general instruction unit configured to issue instructions to a group of processing engines in GPC 208 is used, and single instruction, multiple thread (SIMT) technology is used to support the parallel execution of a large number of threads that are usually synchronized. Different from the SIMD execution mechanism that all processing engines usually execute the same instruction, SIMT execution allows different threads to more easily follow different execution paths through a given program. It will be understood by those of ordinary skill in the art that the SIMD processing mechanism represents a functional subset of the SIMT processing mechanism.

[0039] The operation of GPC 208 is controlled via pipeline manager 305, which distributes processing tasks received from a work distribution unit (not shown) within task / work unit 207 to one or more streaming multiprocessors (SMs) 310. Pipeline manager 305 may also be configured to control work distribution crossbar 330 by specifying the destination of processing data output by SM 310.

[0040] In one embodiment, the GPC 208 includes a set of M SMs 310, where M ≥ 1. In addition, each SM 310 includes a set of functional execution units (not shown), such as execution units and load-store units. Processing operations specific to any functional execution unit can be pipelined, which enables a new instruction to be issued for execution before the previous instruction completes execution. Any combination of functional execution units within a given SM 310 can be provided. In various embodiments, the functional execution units can be configured to support a variety of different operations, including integer and floating-point arithmetic (e.g., addition and multiplication), comparison operations, Boolean operations (AND, OR, XOR), bit shifts, and calculations of various algebraic functions (e.g., plane interpolation and trigonometric functions, exponential functions and logarithmic functions, etc.). Advantageously, the same functional execution unit can be configured to perform different operations.

[0041] In operation, each SM 310 is configured to process one or more thread groups. As used herein, a "thread group" or "warp" refers to a group of threads that execute the same program simultaneously on different input data, and a thread in the group is assigned to a different execution unit within the SM 310. A thread group may include fewer threads than the number of execution units in the SM 310, in which case some executions may be idle during the cycle in which the thread group is being processed. A thread group may also include more threads than the number of execution units in the SM 310, in which case processing can be performed in consecutive clock cycles. Since each SM 310 can support up to G thread groups simultaneously, up to G*M thread groups can be executed in the GPC 208 at any given time.

[0042] Additionally, multiple related thread groups may be simultaneously active (in different stages of execution) in an SM 310. This collection of thread groups is referred to herein as a "cooperative thread array" ("CTA") or "thread array." The size of a particular CTA is equal to m*k, where k is the number of threads executing simultaneously in the thread group, typically an integer multiple of the number of execution units in an SM 310, and m is the number of thread groups that are simultaneously active in an SM 310.

[0043] Although not in Figure 3A 204 and / or system memory 104. It should be understood that any memory external to the PPU 202 may be used as global memory. In addition, as shown in FIG. 1 , the SM 310 may also access off-chip “global” memory, which may include PP memory 204 and / or system memory 104. It should be understood that any memory external to the PPU 202 may be used as global memory. In addition, as shown in FIG. 1 , the SM 310 may also access off-chip “global” memory, which may include PP memory 204 and / or system memory 104. As shown in FIG. 1 , the SM 310 may also access off-chip “global” memory, which may include PP memory 204 and / or system memory 104. It should be understood that any memory external to the PPU 202 may be used as global memory. In addition, as shown in FIG. 1 , the SM 310 may also access off-chip “global” memory, which may include PP memory 204 and / or system memory 104. Figure 3A As shown, a level 1.5 (L1.5) cache 335 may be included in GPC 208 and is configured to receive and store data requested by SM 310 from memory via memory interface 214. Such data includes, but is not limited to, instructions, uniform data, and constant data. In embodiments with multiple SMs 310 within GPC 208, SMs 310 may beneficially share common instructions and data cached in L1.5 cache 335.

[0044] Each GPC 208 may have an associated memory management unit (MMU) 320 that is configured to map virtual addresses to physical addresses. In various embodiments, the MMU 320 may reside within the GPC 208 or within the memory interface 214. The MMU 320 includes a set of page table entries (PTEs) that are used to map virtual addresses to physical addresses of tiles or memory pages and optionally to cache line indices. The MMU 320 may include an address translation lookaside buffer (TLB) or cache that may reside in the SM 310, in one or more L1 caches, or in the GPC 208.

[0045] In graphics and compute applications, GPC 208 may be configured such that each SM 310 is coupled to a texture unit 315 to perform, among other things, texture loads and texture operations (eg, determining texture sample locations, reading texture data, and filtering texture data).

[0046] In operation, each SM 310 sends a processed task to the work distribution crossbar 330 so that the processed task is provided to another GPC 208 for further processing, or the processed task is stored in an L2 cache (not shown), parallel processing memory 204, or system memory 104 via the crossbar unit 210. In addition, a pre-raster operation (preROP) unit 325 is configured to receive data from the SM 310, direct the data to one or more raster operation (ROP) units in the partition unit 215, perform optimization of color blending, organize pixel color data, and perform address translation.

[0047] It should be understood that the core architecture described herein is exemplary and that variations and modifications are possible. Among other things, any number of processing units (e.g., SM 310), texture units 315, or preROP units 325 may be included within GPC 208. In addition, as described above and in conjunction with Figure 2 , a PPU 202 may include any number of GPCs 208 that are configured to be functionally similar to one another so that execution behavior does not depend on which GPC 208 receives a particular processing task. In addition, each GPC 208 operates independently of the other GPCs 208 in the PPU 202 to execute tasks for one or more applications. In view of the foregoing, one of ordinary skill in the art will appreciate that Figure 1-Figure 3A The architecture described in no way limits the scope of the present disclosure.

[0048] Graphics pipeline architecture

[0049] Figure 3B According to various embodiments, Figure 2 3. A conceptual diagram of a graphics processing pipeline 350 implemented within a parallel processing unit 202 of FIG. As shown, the graphics processing pipeline 350 includes, but is not limited to, a primitive distributor (PD) 355; a vertex attribute fetch unit (VAF) 360; a vertex, tessellation, and geometry processing unit (VTG) 365; a viewport scaling, culling, and clipping unit (VPC) 370; a tiling unit 375, a setup unit (SETUP) 380, a rasterizer (Rasterizer) 385; a fragment processing unit (also known as a pixel shader (PS)) 390, and a raster operations unit (ROP) 395.

[0050] PD 355 collects vertex data associated with high-order surfaces, graphics primitives, etc. from front end 212 and sends the vertex data to VAF 360 .

[0051] VAF 360 retrieves vertex attributes associated with each incoming vertex from shared memory and stores the vertex data along with the associated vertex attributes into shared memory.

[0052] The VTG 365 is a programmable execution unit configured to execute vertex shader programs, tessellation programs, and geometry programs. These programs process vertex data and vertex attributes received from the VAF 360 and generate graphics primitives and graphics primitive color values, surface normal vectors, and transparency values ​​at each vertex for further processing in the graphics processing pipeline 350. Although not explicitly shown, in some embodiments, the VTG 365 may include one or more vertex processing units, tessellation initialization processing units, task generation units, task distributors, topology generation units, tessellation processing units, and geometry processing units.

[0053] The vertex processing unit in the VTG 365 is a programmable execution unit that is configured to execute vertex shader programs, illuminate and transform vertex data specified by the vertex shader programs. For example, the vertex processing unit can be programmed to transform vertex data from an object-based coordinate representation (object space) to an alternative-based coordinate system (e.g., natural space or standardized device coordinate (NDC) space). The vertex processing unit can read vertex data and vertex attributes stored in shared memory by the VAF, and can process the vertex data and vertex attributes. The vertex processing unit 415 stores the processed vertices in shared memory.

[0054] The tessellation initialization processing unit in the VTG 365 is a programmable execution unit that is configured to execute a tessellation initialization shader program. The tessellation initialization processing unit processes the vertices generated by the vertex processing unit and generates graphics primitives called patches. The tessellation initialization processing unit also generates various patch attributes. The tessellation initialization processing unit then stores the patch data and patch attributes in a shared memory. In some embodiments, the tessellation initialization shader program may be referred to as a shell shader or a tessellation control shader.

[0055] The task generation unit in the VTG 365 obtains vertex and patch data and attributes from the shared memory. The task generation unit generates tasks for processing vertices and patches for processing by later stages in the graphics processing pipeline 350. The task distributor in the VTG 365 redistributes the tasks generated by the task generation unit. The tasks generated by the various instances of the vertex shader program and the tessellation initializer can vary significantly from one graphics processing pipeline 350 to another. The task distributor redistributes these tasks so that each graphics processing pipeline 350 has approximately the same workload in subsequent pipeline stages.

[0056] The topology generation unit in VTG 365 retrieves the tasks distributed by the task distributor. The topology generation unit indexes the vertices (including the vertices associated with the patches) and calculates the (U, V) coordinates of the tessellation vertices and the indices that connect the tessellation vertices to form graphics primitives. The topology generation unit then stores the indexed vertices in a shared memory.

[0057] The tessellation processing unit in VTG 365 is a programmable execution unit that is configured to execute a tessellation shader program. The tessellation processing unit reads input data from a shared memory and writes output data to a shared memory. The output data in the shared memory is passed to the next shader stage (geometry processing unit 445) as input data. In some embodiments, the tessellation shader program may be referred to as a domain shader or a tessellation evaluation shader.

[0058] The geometry processing unit in the VTG 365 is a programmable execution unit that is configured to execute geometry shader programs, thereby transforming graphics primitives. Vertices are grouped to construct graphics primitives for processing, where graphics primitives include triangles, line segments, points, etc. For example, the geometry processing unit can be programmed to subdivide a graphics primitive into one or more new graphics primitives and calculate parameters, such as plane equation coefficients, for rasterizing the new graphics primitives.

[0059] The geometry processing unit in VTG 365 sends the parameters and vertices specifying the new graphics primitives to VPC 370. The geometry processing unit can read the data stored in the shared memory for processing the geometry data. VPC 370 performs pruning, culling, perspective correction, and viewport transformation to determine which graphics primitives are potentially visible in the final rendered image and which graphics primitives are potentially invisible. VPC 370 then sends the processed graphics primitives to stitching unit 375.

[0060] The tiling unit 375 is a graphics primitive sorting engine that exists between the natural space pipeline 352 and the screen space pipeline 354, as further described herein. Graphics primitives are processed in the natural space pipeline 352 and then sent to the tiling unit 375. The screen space is divided into cache tiles, where each cache tile is associated with a portion of the screen space. For each graphics primitive, the tiling unit 375 identifies a set of cache tiles that intersect the graphics primitive, a process referred to herein as "tiling". After tiling a certain number of graphics primitives, the tiling unit 375 processes the graphics primitives based on the cache tiles, where the graphics primitives associated with a particular cache tile are sent to the setup unit 380. The tiling unit 375 sends the graphics primitives to the setup unit 380 one cache tile at a time. Graphics primitives that intersect multiple cache tiles are typically processed once in the natural space pipeline 352, but then sent to the screen space pipeline 354 multiple times.

[0061] Such a technique improves the locality of cache memory during processing in the screen space pipeline 354, where multiple memory operations associated with a first cache tile access an area of ​​the L2 cache or any other technically feasible cache memory that can remain resident during screen space processing of the first cache tile. Once the graphics primitive associated with the first cache tile is processed by the screen space pipeline 354, the portion of the L2 cache associated with the first cache tile can be flushed, and the tiling unit can send the graphics primitive associated with the second cache tile. Then, multiple memory operations associated with the second cache tile can access an area of ​​the L2 cache that can remain resident during screen space processing of the second cache tile. Therefore, the total storage traffic to the L2 cache and to the rendering target can be reduced. In some embodiments, natural space calculations are performed only once for a given graphics primitive, regardless of the number of cache tiles that intersect the graphics primitive in screen space.

[0062] The setup unit 380 receives vertex data from the VPC 370 via the tiling unit 375 and calculates parameters associated with the graphics primitives, including but not limited to edge equations, local plane equations, and depth plane equations. The setup unit 380 then sends the processed graphics primitives to the rasterizer 385.

[0063] The rasterizer 385 scan converts the new graphics primitives and sends the fragments and coverage data to the pixel shading unit 390. In addition, the rasterizer 385 may be configured to perform z-culling and other z-based optimizations.

[0064] The pixel shading unit 390 is a programmable execution unit that is configured to execute a fragment shader program to transform fragments received from the rasterizer 385 as specified by the fragment shader program. The fragment shader program can shade fragments at a pixel level granularity, where such a shader program can be referred to as a pixel shader program. Alternatively, the fragment shader program can shade fragments at a sample level granularity, where each pixel includes multiple samples and each sample represents a portion of a pixel. Alternatively, the fragment shader program can shade fragments at any other technically feasible granularity according to a programmed sampling rate.

[0065] In various embodiments, fragment processing unit 460 may be programmed to perform operations such as perspective correction, texture mapping, shading, blending, etc. to produce shaded fragments that are sent to ROP 395. Pixel shading unit 390 may read data stored in shared memory.

[0066] ROP 395 is a processing unit that performs raster operations such as stencil, z-test, blending, etc., and sends pixel data as processed graphics data to be stored in graphics memory via memory interface 214, where graphics memory is generally structured as one or more rendering targets. The processed graphics data can be stored in graphics memory, parallel processing memory 204, or system memory 104 for display on display device 110 or further processing by CPU 102 or parallel processing subsystem 112. In some embodiments, ROP 395 is configured to compress z data or color data written to memory and decompress z data or color data read from memory. In various embodiments, ROP 395 can be located in memory interface 214, in GPC 208, in processing cluster array 230 outside of GPC, or in a separate unit (not shown) within PPU 202.

[0067] Graphics processing pipeline 350 may be implemented by any one or more processing elements within PPU 202. For example, Figure 3AOne of the SMs 310 in a PPU 202 may be configured to perform the functions of one or more of the VTG 365 and the pixel shading unit 390. The functions of the PD 355, VAF 360, VPC 450, tiling unit 375, setup unit 380, rasterizer 385, and ROP 395 may also be performed by processing elements in a particular GPC 208 in conjunction with the corresponding partition unit 215. Alternatively, a graphics processing pipeline 350 may be implemented using dedicated fixed-function processing elements for one or more of the functions listed above. In various embodiments, the PPU 202 may be configured to implement one or more graphics processing pipelines 350.

[0068] In some embodiments, the graphics processing pipeline 350 can be divided into a natural space pipeline 352 and a screen space pipeline 354. The natural space pipeline 352 processes graphics objects in 3D space, where the position of each graphics object is known relative to other graphics objects and relative to a 3D coordinate system. The screen space pipeline 354 processes graphics objects that have been projected from the 3D coordinate system to a 2D plane representing the surface of the display device 110. For example, the natural space pipeline 352 can include pipeline stages in the graphics processing pipeline 350 from the PD 355 to the VPC 370. The screen space pipeline 354 can include pipeline stages in the graphics processing pipeline 350 from the setup unit 380 to the ROP 395. The stitching unit 375 will follow the last stage of the natural space pipeline 352 (i.e., the VPC 370). The stitching unit 375 will be located before the first stage of the screen space pipeline 354 (i.e., the setup unit 380).

[0069] In some embodiments, the natural space pipeline 352 can be further divided into an alpha phase pipeline and a beta phase pipeline. For example, the alpha phase pipeline can include pipeline stages in the graphics processing pipeline 350 from the PD 355 to the task generation unit. The beta phase pipeline can include pipeline stages in the graphics processing pipeline 350 from the topology generation unit to the VPC 370. The graphics processing pipeline 350 performs a first set of operations during processing in the alpha phase pipeline and performs a second set of operations during processing in the beta phase pipeline. As used herein, a set of operations is defined as one or more instructions that are uniformly executed by a single thread, by a thread group, or by multiple thread groups.

[0070] In a system having multiple graphics processing pipelines 350, vertex data and vertex attributes associated with a set of graphics objects may be divided so that each graphics processing pipeline 350 has approximately the same workload throughout the alpha phase. Alpha phase processing may greatly expand the amount of vertex data and vertex attributes, so that the amount of vertex data and vertex attributes generated by the task generation unit is significantly greater than the amount of vertex data and vertex attributes processed by the PD 355 and the VAF 360. In addition, even in the case where two graphics processing pipelines 350 process the same number of attributes at the beginning of the alpha phase pipeline, the task generation unit associated with one graphics processing pipeline 350 may generate a significantly larger amount of vertex data and vertex attributes than the task generation unit associated with the other graphics processing pipeline 350. In such a case, the task distributor redistributes the attributes generated by the alpha phase pipeline so that each graphics processing pipeline 350 has approximately the same workload at the beginning of the beta phase pipeline.

[0071] Note that, as used herein, references to shared memory may include any one or more technically feasible memories, including but not limited to local memory shared by one or more SMs 310 or memory accessible via memory interface 214, such as cache memory, parallel processing memory 204, or system memory 104. It should also be noted that, as used herein, references to cache memory may include any one or more technically feasible memories, including but not limited to L1 cache, L1.5 cache, and L2 cache.

[0072] The image generated by applying one or more of the techniques disclosed herein can be displayed on a monitor or other display device. In some embodiments, the display device can be directly coupled to a system or processor that generates or renders an image. In other embodiments, the display device can be indirectly coupled to the system or processor, for example, via a network. Examples of such networks include the Internet, mobile telecommunications networks, WIFI networks, and any other wired and / or wireless networking systems. When the display device is indirectly coupled, the image generated by the system or processor can be streamed to the display device via a network. This streaming allows, for example, a video game or other application that renders an image to be executed on a server or in a data center, and the rendered image will be transmitted and displayed on one or more user devices (e.g., computers, video game consoles, smartphones, other mobile devices, etc.), which are physically separated from the server or data center. Therefore, the technology disclosed herein can be applied to enhance the image being streamed, and enhance the service of streaming images, such as NVIDIA GeForceNow (GFN), Google Stadia, etc.

[0073] In addition, images generated using one or more of the techniques disclosed herein can be used to train, test, or demonstrate deep neural networks (DNNs) for recognizing objects and environments in the real world. Such images can include roads, factories, buildings, urban environments, rural environments, humans, animals, and any other physical objects or scenes set in the real world. Such images can be used to train, test, or demonstrate DNNs used in machines or robots to manipulate, process, or modify physical objects in the real world. In addition, such images can be used to train, test, or demonstrate DNNs used in autonomous vehicles to navigate and move vehicles throughout the real world. In addition, images generated using one or more of the techniques disclosed herein can be used to convey information to users of these machines, robots, and vehicles. Texture memory queries for texture operations and texture loading

[0074] Figure 4 According to various embodiments, it can be configured Figure 3A 4. A conceptual diagram of a texture processing pipeline 400 implemented by a texture unit 315 within a general processing cluster 208 of FIG. 4. As shown, the texture processing pipeline 400 includes a texture input / output (TEXIO) unit 402, a texture input (TEXIN) unit 404, a level of detail (LOD) unit 406, a sampling control and address unit 408, a tag unit 410, a miss handling unit 412, a data first-in-first-out memory (FIFO) 414, a data unit 416, a filter weight unit 418, a filter weight FIFO 420, a filter and return unit 422, and an accelerated point sampling (APS) bypass FIFO 424.

[0075] As described herein, a texture is a 2D picture or image composed of pixels and stored in a texture memory. The pixels included in the texture are referred to herein as "texture pixels". The texture pixels also have a position (position) or location (location) that identifies where the texture pixel is in the texture. For example, the position of the texture pixel in the second column of the third row in the texture is (2, 3). In the texture, the column number of the texture pixel is referred to as the "u coordinate" in this article, and the row number of the texture pixel is referred to as the "v coordinate" in this article. When the position is represented as a pair of integer values, the position identifies a single texture pixel in the texture. The application executes texture instructions, which access one or more texture pixels in the texture memory. Such texture instructions include texture operations and texture loads, which are now described.

[0076] Texture operations perform calculations based on one or more pixels in the texture. Typically, texture operations include floating point numbers to describe the position in the texture, such as (2.4, 3.6). The position represented as a pair of floating point or other non-integer values ​​is within the range of four texture pixels. For example, the position (2.4, 3.6) will be within the range of four texture pixels located at (2, 3), (3, 3), (2, 4) and (3, 4). As a result, the texture operation for the position (2.4, 3.6) will retrieve these four texture pixels, perform a weighted average of the color values ​​at the four texture pixel positions, and then calculate the final color based on the weighted average. In some embodiments, certain filtering functions can access more than four texture pixels per thread. For example, 16x trilinear anisotropic filtering, each thread can access up to 128 texture pixels. The weighted average can be any technically feasible operation, including but not limited to bilinear interpolation, trilinear interpolation, and various filtering operations. In turn, the application performing the texture operation will receive a single color value based on the weighted average of the four texture pixels.

[0077] In contrast, a texture load retrieves only a single texture pixel value at an integer-addressed location in texture memory, where the integer-addressed location is a texture pixel identified by an integer coordinate. In some embodiments, certain texture load and point sampling texture operations may employ floating-point coordinates, where the floating-point coordinates implicitly address four different nearby texture pixels simultaneously. Using texture load and point sampling texture operations, the texture processing pipeline 400 does not perform filtering operations. An application may prefer expired texture loads over texture operations, such as when the application performs custom weighted averaging, interpolation, and filtering operations that are not supported by the built-in weighted averaging performed by the texture processing pipeline 400. Such an application performs four texture load operations for texture pixels located at (2, 3), (3, 3), (2, 4), and (3, 4), and in return receives a single color value located at these four texture pixel locations. The application can then perform any blending or merging operations on the four texture pixels.

[0078] Typically, the texture processing pipeline 400 is optimized to perform texture operations. When a particular thread performs a texture operation, the thread will receive a color value based on a weighted average of the color values ​​of four individual texture pixels. Therefore, the texture processing pipeline 400 is optimized to access up to four texture pixels simultaneously via four separate memory ports in a single memory access cycle. When a thread performs a texture texel load for a single texture pixel, the texel load only accesses one texel via a single memory port in a single memory cycle. As a result, the remaining three memory ports are unused. To access four texture pixels via a texture load, four texture loads are performed sequentially, each texture load accessing a single memory port once. As a result, the time for a single texture operation to be performed is approximately one-quarter of the time for four texture loads. In addition, because the texture load does not perform a weighted average to calculate the final color, the portion of the texture processing pipeline 400 that performs the weighted average is not used, resulting in further inefficiency.

[0079] In some embodiments, the texture processing pipeline 400 can accommodate multiple threads simultaneously. For example, if the texture processing pipeline 400 is configured to support four concurrent threads, the texture processing pipeline 400 has sixteen memory ports to support four threads performing four texture operations, each texture operation accessing four texture pixels. If four threads perform one texture load, then four memory ports are used to support the four texture loads, and the remaining twelve memory ports are unused. As a result, the texture load is performed with four texture pixel accesses per clock cycle, while the texture operation is performed with sixteen texture pixel accesses per clock cycle.

[0080] As further described herein, texture loads for "N" different threads may be combined in the texture processing pipeline 400 to improve utilization of texture pixel accesses, thereby improving performance of the texture processing pipeline during texture loads. In general, "N" may be any number that does not exceed the number of threads in a warp. In some embodiments, "N" may exceed the number of threads if a warp-wide texture instruction is encoded with more than one texture load per thread. In such embodiments, "N" may be any number that does not exceed the number of texture loads encoded in the warp-wide texture instruction.

[0081] In addition, certain types of texture operations for "N" different threads can be combined in the texture processing pipeline 400 to improve the utilization of texture pixel accesses, thereby improving the performance of the texture processing pipeline during these specific types of texture operations. These specific types of texture operations are referred to herein as point-sampled texture operations. Point-sampled texture operations are simple texture operations that request texture pixels closest to a specific floating point location in the texture memory. For example, a point-sampled texture operation pointing to a location (2.4, 3.6) can return the color of the texture pixel located at (2, 4). In some embodiments, the texture processing pipeline 400 can be configured to improve the performance of texture collection operations, where each thread performs a load of a point sample of a component from four surrounding texture elements. More specifically, the texture collection operation accesses the four adjacent texture elements in the texture memory that are closest to the location specified by the texture memory query. For example, a texture collection operation for a location (2.4, 3.6) can perform a load of a point sample of the red component for texture pixels located at (2, 3), (2, 4), (3, 3), and (3, 4). As further described, the texture processing pipeline 400 may be configured to combine texture operations and / or texture gather operations for point sampling of “N” different threads to improve the utilization of texture pixel accesses.

[0082] If "N" = 2, the portion of the texture processing pipeline 400 that was configured to access up to four texture pixel accesses for one thread can now access up to one texture pixel for each of two threads simultaneously. If this portion of the texture processing pipeline 400 performs texture loads for two threads, the texture processing pipeline 400 accesses two texture pixels, one texture pixel for each of the two threads. For example, if the texture processing pipeline 400 is configured to support four concurrent texture operations, then when performing texture loads, eight memory ports are used to support eight texture loads for eight threads, and the remaining eight memory ports are not used. As a result, texture loads are performed with eight texture pixel accesses per clock cycle, while texture operations are performed with sixteen texture pixel accesses per clock cycle. In some embodiments, texture pixels can have multiple sizes. If texture pixels are larger than memory ports within the texture processing pipeline 400, multiple memory ports can be used for each texture pixel. For example, if the texture processing pipeline 400 has 8-byte memory ports, and the texel size is 16 bytes per texel, the texture processing pipeline 400 employs paired memory ports to support 8 threads / cycle texture loads, thus fully occupying all 16 8-byte memory ports.

[0083] If "N" = 4, then the portion of the texture processing pipeline 400 that was configured to access up to four texel accesses for one thread can now access up to one texel access for four threads. If this portion of the texture processing pipeline 400 performs texture loads for four threads, then the texture processing pipeline 400 accesses four texels, one texel for each of the four threads. For example, if the texture processing pipeline 400 is configured to support four concurrent texture operations, then when performing texture loads, all sixteen memory ports are used to support sixteen texture loads for sixteen threads, and no memory port is idle. As a result, texture loads are performed with sixteen texel accesses per clock cycle, and texture operations are also performed with sixteen texel accesses per clock cycle.

[0084] The stages of the texture processing pipeline 400 are now described.

[0085] In operation, TEXIO unit 402 processes texture instructions, including texture loads and texture operations. TEXIO unit 402 receives texture instructions from SM 310 for execution by 32 threads in a warp. TEXIO unit 402 divides the texture instructions into multiple parts, where each part includes texture instructions for a subset of threads in a warp. TEXIO unit 402 analyzes the texture instruction operation code (also referred to herein as "opcode") and certain parameters and modifiers of the texture instruction to make a first determination as to whether the texture instruction can be executed with four threads per clock cycle or with more threads per clock cycle.

[0086] Initially, the TEXIO unit 402 assumes that texture instructions can be executed at a rate greater than four threads per clock cycle. Therefore, the TEXIO unit 402 retrieves the parameters of the texture instruction from the parameter queue (not shown) in a manner that can support more than four threads per clock, such as but not limited to an execution rate of eight threads per cycle. As a result, the parameter packing of the three-parameter texture instruction is different from the parameter packing of the four-parameter texture instruction. In the case of the four-parameter texture instruction, the texture instruction parameters are packed in a four-parameter packing manner. If the three-parameter texture instruction is also packed with the four-parameter packing, the texture processing pipeline 400 may not be able to retrieve and process the parameters when executed at a rate greater than four threads per clock cycle. However, when the parameters are packed in groups of powers of two, the parameter packing is more effective. Therefore, in the case of the three-parameter texture instruction, the texture instruction parameters are packed alternately by one-parameter packing and two-parameter packing. In this way, the parameters for the three-parameter texture instruction are compactly packed in groups of powers of two, and the texture processing pipeline can maintain an execution rate greater than four threads per clock cycle.

[0087] If the TEXIO unit 402 determines that the texture instruction cannot be executed at a higher execution rate than four threads per clock cycle, the TEXIO unit 402, at this stage, "vetoes" the determination that the texture instruction can be executed at a rate according to the current configuration. The TEXIO unit 402 then reconfigures the instruction to execute at a lower rate. For example, the TEXIO unit 402 may veto the configuration of the texture instruction to execute at eight threads per clock cycle, and may reconfigure the texture instruction to execute at four threads per clock cycle.

[0088] If the TEXIO unit 402 determines that the texture instruction can only be executed at four threads per clock cycle, the TEXIO unit 402 splits the texture instruction into eight parts, each with four threads, and executes at a rate of four threads per clock cycle. If the TEXIO unit 402 determines that the texture instruction can be executed at a rate greater than four threads per clock cycle, such as with texture loading, the TEXIO unit 402 will split the texture instruction into multiple parts based on the value of "N". For example, if "N" = 2, the texture instruction that can be executed at a higher rate is split into four parts, each with eight threads, and the texture instruction is executed at a rate of eight threads per clock cycle. If "N" = 4, the texture instruction will be divided into two parts for each sixteen threads, and the texture instruction is executed at a rate of sixteen threads per clock cycle, and so on. For the following discussion, "N" is assumed to be 2. However, "N" can be any technically feasible number.

[0089] In some cases, the TEXIO unit 402 may not be able to determine whether the texture instruction can be executed with four threads per clock cycle or eight threads per clock cycle based on the opcode. In this case, the TEXIO unit 402 makes an optimistic assumption that the subsequent stages of the texture processing pipeline 400 can support a higher texture instruction execution rate. Subsequently, any other stage of the texture processing pipeline 400 may determine that the texture instruction cannot be executed under the current configuration. If a stage of the texture processing pipeline 400 determines that the texture instruction cannot be executed at the currently configured rate, the stage vetoes the determination that the texture instruction can be executed at the rate according to the current configuration. More specifically, when a given stage in the texture processing pipeline 400 receives a texture instruction to be executed within one clock cycle, but the stage requires multiple clock cycles to execute the texture instruction, the stage stalls the pipeline, splits the texture instruction into sub-blocks, and executes each sub-block of the texture instruction in sequence. The stage reconfigures the texture instruction to execute at a lower rate. For example, the stage may veto the configuration of the texture instruction to be executed with eight threads per clock cycle, and reconfigure the texture instruction to be executed with four threads per clock cycle. As described herein, TEXIN unit 404 can override the determination that texture instructions can be executed at a rate according to the current configuration. More generally, any technically feasible stage of the texture processing pipeline can override the determination.

[0090] The TEXIN unit 404 receives the split texture instruction from the TEXIO unit 402. The TEXIN unit 404 retrieves the texture header state and the texture sampler state from the memory based on the texture header index and the texture sampler index included in the texture instruction. The texture header state and the texture sampler state are stored in a memory outside the texture processing pipeline 400. The TEXIN unit 404 stores the retrieved texture header state and the texture sampler state in a local memory cache (not shown). Each stage in the texture processing pipeline 400 retrieves the texture header state and the texture sampler state as needed to perform the operation of the stage. In addition, if a subsequent texture instruction includes the same texture header index and / or texture sampler index as the previous texture instruction, the TEXIN unit 404 can access the texture header state and the texture sampler state via the local memory cache. Accessing the texture header state and the texture sampler state via the local memory cache avoids retrieving the texture header state and the texture sampler state from the external memory when the state exists in the local memory cache.

[0091] The texture header index is a pointer to a texture header state data table that describes the format of the texture in memory, including, but not limited to, the location of the texture in memory, the dimensions of the texture, the number of color components per texel, the number of bits per color component, and whether the texture data is compressed. The sampler header index is a pointer to a texture sampler state data table that describes how the texture will be sampled and the type of filtering applied to texels received from the texture.

[0092] The TEXIN unit 404 analyzes the texture header state and the texture sampler state associated with the texture instruction to make a second determination as to whether the texture instruction can be executed with eight threads per clock cycle or with four threads per clock cycle. If the TEXIN unit 404 determines that the incoming texture instruction configured to be executed with eight threads per clock cycle can only be executed with four threads per clock cycle, the TEXIN unit 404 overrules the configuration. The TEXIN unit 404 reconfigures the texture instruction to be executed with four threads per clock cycle.

[0093] For example, TEXIN unit 404 can determine whether the texture instruction is a texture operation that requests point sampling of the nearest texture pixel based on the texture sampler state. If the texture instruction is a texture operation that requests point sampling, TEXIN unit 404 determines that the texture instruction can be executed with eight threads per clock cycle. On the other hand, TEXIN unit 404 can determine that the texture instruction is associated with a more complex sampling or filtering operation based on the texture sampler state. In this case, TEXIN unit 404 overrules the texture instruction and reconfigures the instruction to be executed with four threads per clock cycle. Similarly, if the texture header state data indicates that the texture instruction is for a texture that includes compressed data, TEXIN unit 404 determines that the texture instruction can be executed with four threads per clock cycle.

[0094] Some of the state data is a cross product of a texture instruction, a header state, and a sampler state. In this case, the TEXIN unit 404 determines whether to overrule the configuration of the texture instruction based on some combination of the texture instruction, the header state, and the sampler state. The texture processing pipeline 400 maintains separate storage for the texture instruction, the header state, and the sampler state in order to properly access the texture. Maintaining this separate storage enables the TEXIN unit 404 and other stages of the texture processing pipeline 400 to make overrule decisions based on this cross product state data.

[0095] If the texture instruction is neither a texture load nor a point sampling texture operation, the TEXIN unit 404 sends the instruction to the LOD unit 406 for execution with four threads per clock cycle. If the texture instruction is a texture load or a point sampling texture operation, the TEXIN unit 404 sends the instruction to the APS bypass unit 424 for execution with four threads per clock cycle "N". For example, if "N" = 2, the TEXIN unit 404 sends the instruction to the APS bypass unit 424 for execution with eight threads per clock cycle.

[0096] The LOD unit 406 is configured to calculate the "level of detail" of a texture to be accessed from memory based on the position and orientation of a set of texture pixel coordinates included in the texture instruction. Four threads operating together can execute a texture instruction that includes coordinates of four positions that define a geometric primitive (e.g., a quadrilateral) on a surface in a 3D graphics scene. The LOD unit 406 calculates the level of detail based on the distance between the four positions and selects a corresponding texture from a set of textures. Each texture in the set of textures defines the same texture image, but has a different spatial resolution or level of detail. When the four positions are mapped to corresponding texture pixel positions, the LOD unit 406 selects the texture that minimizes the distance between the four texture pixels. After calculating the level of detail, the LOD unit 406 sends the texture instruction to the sampling control and address unit 408.

[0097] The APS bypass FIFO 424 is a delay matching FIFO to match the delay of the LOD unit 406. In some embodiments, some texture instructions executed within the texture processing pipeline 400 may employ the LOD unit 406, while other texture instructions (e.g., texture operations of texture loading and point sampling) executed within the texture processing pipeline 400 may not employ the LOD unit 406. Texture instructions that employ the LOD unit 406 pass through the LOD unit 406. Texture instructions that do not employ the LOD unit 406 do not pass through the LOD unit 406. If the LOD unit 406 is not currently processing any texture operation, and the TEXIN unit 404 sends a texture instruction that does not use the LOD unit 406, the texture instruction bypasses the LOD unit 406. The texture instruction passes through the APS bypass FIFO 424 with almost no delay and reaches the sampling control and address unit 408. If the LOD unit 406 is currently processing any texture operation, and the TEXIN unit 404 issues a texture instruction that does not use the LOD unit 406, then the texture instruction bypasses the LOD unit 406. The texture instruction enters the APS bypass FIFO 424 and remains in the APS bypass FIFO 424 until the texture instruction processing through the LOD unit 406 reaches the sampling control and address unit 408. Subsequently, the texture instruction in the APS bypass FIFO 424 reaches the sampling control and address unit 408. In this way, the original order is maintained through the texture instruction processing of the LOD unit 406 and the APS bypass FIFO 424.

[0098] In operation, the sampling control and address unit 408 receives texture instructions from the LOD unit 406 and the APS bypass FIFO 424. The stream of texture instructions from the LOD unit 406 is in order. Likewise, the stream of texture instructions from the APS bypass FIFO 424 is in order. However, a subsequent texture instruction from the LOD unit 406 may arrive at the sampling control and address unit 408 before an earlier texture instruction from the APS bypass FIFO 424. Likewise, a subsequent texture instruction from the APS bypass FIFO 424 may arrive at the sampling control and address unit 408 before an earlier texture instruction from the LOD unit 406. Since the sampling control and address unit 408 receives texture instructions from two different sources, the texture instructions may be out of order. Therefore, the sampling control and address unit 408 detects out of order texture instructions and selects a texture instruction from the LOD unit 406 and the APS bypass FIFO 424 based on which texture instruction has an earlier timestamp. In this manner, the sampling control and address unit 408 orders the texture instruction stream from the LOD unit 406 and the APS bypass FIFO 424 into the correct order to be sent by the TEXIN unit 404 .

[0099] The sampling control and address unit 408 performs various sampling and filtering operations on certain texture instructions. The sampling control and address unit 408 also provides information on how to sample textures for certain texture instructions. The sampling control and address unit 408 also processes texture instructions that have texture pixel coordinates that extend beyond the boundaries of a given texture or cross the boundary between two textures. The sampling control and address unit 408 compares the texture pixel coordinates with the size of the selected texture. If the texture pixel coordinates are outside the boundaries of the selected texture, the sampling control and address unit 408 performs one or more operations to process the out-of-bounds texture pixel coordinates. The sampling control and address unit 408 can clamp or limit the out-of-bounds coordinates to the boundaries of the texture. Additionally or alternatively, the sampling control and address unit 408 can "wrap" the out-of-bounds coordinates to the opposite side of the texture by performing a MOD operation on the out-of-bounds coordinates. Additionally or alternatively, the sampling control and address unit 408 can invalidate or discard texture operations that include one or more out-of-bounds coordinates. In this way, the sampling control and address unit 408 ensures that all texture pixel coordinates are within the boundaries of the relevant texture.

[0100] If the current texture operation is a texture load or point sampling texture operation, these filtering operations are not performed. In contrast, if the coordinates for a texture load or point sampling texture operation are in floating point format, the sampling control and address unit 408 converts the coordinates to integer texture pixel coordinates. This conversion to surface load instructions enables texture load or point sampling texture operations to use existing surface instruction circuitry, which has been optimized to accommodate eight threads.

[0101] In addition, the sampling control and address unit 408 performs various address calculations based on the texture pixel coordinates and detail level within the texture instruction to generate a tag. The tag corresponds to an entry in a tag table included in the tag unit 410. The tag identifies a unique cache line in the memory storing the associated texture pixel. In some embodiments, the cache line may include 128 bytes. The associated offset identifies the location of the first byte of the associated texture pixel within the cache line. In some embodiments, the tag is also associated with a value indicating the size of the associated texture pixel. In some embodiments, the tag can be formed based on the index of the texture pixel, the texture type, and the high bits of the coordinates of all texture pixels stored in the cache line. All texture pixels in a particular cache line share certain high bits of the texture pixel coordinates, where these high bits are partially used to form the tag. The sampling control and address unit 408 passes the texture instruction, the address calculation results, and the sampling control information to the tag unit 410 and the filter weight unit 418. The sampling control and address unit 408 can generate up to 16 texture pixel tag / offset / set identifier combinations per clock cycle to retrieve up to 16 texture pixels simultaneously.

[0102] Tag unit 410 receives up to 16 texture pixel tag / offset / set identifier combinations from sampling control and address unit 408 per clock cycle and sequentially accesses up to 16 texture pixels per clock cycle. Tag unit 410 includes a tag table that stores a set of texture header entries. Each texture header entry in tag unit 410 represents a cache line within data unit 416. Data unit 416 may represent a cache memory resident within texture unit 315, or may represent any technically feasible cache memory associated with SM 310. After receiving a memory access request and address calculation result from sampling control and address unit 408, tag unit 410 determines whether the tag table includes a texture header entry corresponding to the texture data to be retrieved.

[0103] When the tag table includes an entry corresponding to the texture data to be accessed, a cache hit occurs and the tag unit 410 determines that the texture data to be accessed resides in the data unit 416. The tag unit 410 retrieves the entry by searching the tag table and retrieves a pointer to the data within the data unit 416 where the texture data actually resides. The tag unit 410 passes the offset to the data FIFO 414.

[0104] When the tag table does not include a texture header entry corresponding to the texture data to be accessed, a cache miss occurs, and the tag unit 410 causes the miss processing unit 412 to access the requested texture data from the external memory.

[0105] Data FIFO 414, together with filter weight FIFO 420, delays the information from tag unit 410 to insert the appropriate delay. As a result, the data from tag unit 410 and the corresponding data from filter weight unit 418 arrive at data unit 416 at the same time.

[0106] The filter weight unit 418 prepares per-texel weights for interpolation and / or filtering, filters, and returns texel values ​​in a unit 422 .

[0107] Filter weight FIFO 420 delays information from filter weight unit 418 to match delays through tag unit 410, data FIFO 414, and other related stages of texture processing pipeline 400. As a result, data from filter weight unit 418 and corresponding data from tag unit 410 arrive at data unit 416 simultaneously.

[0108] The miss processing unit 412 accesses the requested texture pixel by calculating a virtual address based on the data included in the texture instruction, the texture header, and the texture pixel coordinates calculated by the sampling control and address unit 408. The miss processing unit 412 then sends a read request to read the requested data from the physical location. In various embodiments, the miss processing unit 512 may reside within the texture unit 315 or reside in Figure 3A 4. The data unit 416 receives the texel data from the external memory via the memory interface 214 and the crossbar unit 210. The data unit 416 updates the tag table within the tag unit 410 to reflect the newly cached texels.

[0109] The data unit 416 receives a pointer to a cache line of one or more texture pixels from the data FIFO 414. The data unit 416 also receives corresponding filter weight values ​​(if any) from the filter weight FIFO 420. The data unit 416 retrieves data associated with the one or more texture pixels from the cache memory. The data unit 416 passes the retrieved data and the associated filter weight information to the filter and return unit 422. In some cases, the data unit 416 can serialize access to the texture pixel data into multiple clock cycles to accommodate certain access restrictions to the memory cache within the data unit 416. The data unit 416 collects and deserializes such texture pixel data until all the texture pixel data required to complete each individual request received from the data FIFO 414 is accumulated. Typically, multiple requests received from the data FIFO 414 are executed to complete an entire thread warp instruction. For example, if the thread warp instruction has 32 threads and the texture filtering operation processes 4 threads at a time, 8 requests or more requests received from the data FIFO 414 are executed to complete the texture instruction. Additionally, the texel data stored in the data unit 416 may be compressed via any technically feasible compression technique. In this case, the data unit 416 may decompress the texel data for further processing.

[0110] At this point, the data unit 416 now has the texture pixel data required to complete a portion of the texture instruction, where a portion of the texture instruction is referred to herein as a "wavefront". The texture instruction is passed through the texture processing pipeline 400 as a series of such wavefronts, where each wavefront processes "M" threads per clock cycle. One wavefront is passed from stage to stage within the texture processing pipeline 400 per clock cycle. The wavefront for point sampling texture operations and texture loads can include data values ​​for 8 threads. The wavefront for filtering texture operations can contain data for up to 4 threads. For some texture instructions, the texture pixel data includes one texture pixel per thread, up to the number of available memory ports. For certain other texture instructions, the texture pixel data includes four texture pixels for each of up to 4 threads.

[0111] Using conventional methods, texture instructions, including texture loads or texture operations, return the same amount of data per thread. For example, current techniques can return up to four 32-bit data components for each of four threads in two clock cycles, for a total of four threads times 64 bits or 256 bits. With the disclosed techniques, texture instructions can return up to a total of eight threads times 64 bits or 512 bits per clock cycle.

[0112] The filter and return unit 422 receives data and associated filter weight values ​​from the data unit 416. The filter and return unit 422 applies one or more filters to the received data, including but not limited to isotropic filters and anisotropic filters. The filter and return unit 422 calculates final color values ​​for each portion of the texture instruction, wherein each portion includes the final color values ​​for a portion of the 32 threads in the thread warp. For some texture instructions, the filter and return unit 422 can calculate four final color data values ​​for four threads per clock cycle within eight clock cycles. For some other texture instructions, the filter and return unit 422 can calculate eight final color data values ​​for eight threads per clock cycle within four clock cycles. The filter and return unit 422 also includes a bypass FIFO (not shown) that bypasses the filter and associated logic for texture operations for texture loading and point sampling. The filter and return unit 422 assembles final color data for each of the 32 threads in the thread warp. The filter and return unit 422 sends the final color data for all 32 threads to the SM 310.

[0113] Typically, the stage of texture processing pipeline 400 is performed with eight threads per cycle, unless and until a particular stage does not have enough resources to execute the current texture instruction at this rate. Then, the stage overrules the current configuration of the texture instruction, and reconfigures the texture instruction to execute with four threads per cycle. As described herein, TEXIO unit 402 generates a veto based on the texture instruction opcode and the associated instruction modifier. TEXIN unit 404 generates a veto individually or in any combination based on the texture instruction, the header state and the sampler state. Various non-exclusive conditions that cause a veto are now described.

[0114] In one example, TEXIO unit 402 may receive a texture instruction with an opcode that is not eligible for execution with more than four threads per clock cycle. As a result, TEXIO unit 402 vetoes configuration of the texture instruction.

[0115] In another example, the TEXIO unit 402 may receive a texture load and determine that the texture load is eligible to be executed with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the header state data and determines that the texture is composed of 96-bit wide texture pixels each. Since the texture processing pipeline 400 is not configured to retrieve and process 8 96-bit texture pixels in one clock cycle, the TEXIN unit 404 overrules the configuration of the texture load.

[0116] In yet another example, if the texture operation performs the closest texture pixel sampling, the TEXIO unit 402 can receive the texture operation and determine that the texture operation can be qualified to be executed with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the sampler state data and determines whether the texture operation performs more complex sampling and / or filtering. Because the texture processing pipeline 400 is not configured to process 8 texture pixels with complex sampling and / or filtering in one clock cycle, the TEXIN unit 404 overrules the configuration of the texture operation including such complex sampling and / or filtering. On the other hand, if the texture operation performs the closest texture pixel sampling, the texture operation is qualified to be executed with eight threads per clock cycle, and the TEXIN unit 404 does not overrule the configuration of the texture operation.

[0117] In yet another example, the TEXIO unit 402 may receive a texture operation and determine that the texture operation may be eligible for execution with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the header state data and determines that the texture operation is for a texture that includes compressed texture data. Since the texture processing pipeline 400 is not configured to decompress and process eight texture pixels in one clock cycle, the TEXIN unit 404 overrules the configuration of the texture operation.

[0118] In yet another example, the TEXIO unit 402 may receive a texture operation and determine that the texture operation may be eligible to be executed with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the header status data and determines that the texture operation accesses the LOD unit 406, which can only be executed with four threads per clock cycle. The TEXIN unit 404 determines the number of detail levels included in the texture based on the header status data. If the texture includes multiple detail levels and the texture instruction specifies the calculation of the LOD, the TEXIN unit 404 overrules the configuration of the texture operation and directs the texture operation to the LOD unit 406. On the other hand, if the texture only includes one detail level, then since it is not necessary to determine which detail level to access, it is not necessary to direct the texture operation to the LOD unit 406. Therefore, the TEXIN unit 404 does not overrule the configuration of the texture operation, but directs the texture operation to the APS bypass FIFO 424.

[0119] In yet another example, the TEXIO unit 402 may receive a texture operation and determine that the texture operation may be eligible for execution with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the header status data and determines the addressing mode of the texture operation determined by the sampling control and address unit 408. The addressing mode determines how to handle texture pixel addresses that are beyond the texture range determined by the sampling control and address unit 408. If the addressing mode of the texture operation is a simple addressing mode, such as clamping to the value of the nearest boundary texture pixel, the TEXIN unit 404 will not overrule the configuration of the texture operation. On the other hand, if the addressing mode of the texture operation is a more complex addressing mode that requires additional processing of texture pixels outside the boundary, the TEXIN unit 404 overrules the configuration of the texture operation.

[0120] In yet another example, the TEXIO unit 402 may receive a texture operation and determine that the texture operation may be eligible for execution with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the header state data and determines that the texture operation is for a texture pixel that is converted from one color space to another color space. Since the texture processing pipeline 400 is not configured to process and perform color space conversion on 8 texture pixels in one clock cycle, the TEXIN unit 404 overrules the configuration of the texture operation.

[0121] In yet another example, the TEXIO unit 402 may receive a texture operation and determine that the texture operation may be eligible for execution with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the header state data and determines that the texture operation generates a final color value that requires upconversion before returning the final color value to the SM 310. Because the texture processing pipeline 400 is not configured to process 8 texture pixels and perform upconversion on the final color value in one clock cycle, the TEXIN unit 404 overrules the configuration of the texture operation.

[0122] In yet another example, the TEXIO unit 402 may receive a texture gather operation and determine that the texture gather operation may be eligible to be executed with eight threads per clock cycle. Subsequently, the TEXIN unit 404 accesses the header state data and determines that a particular texture gather operation cannot be executed with eight threads per clock cycle. For example, a texture component accessed by the texture gather operation may have a particular format and / or alignment that the texture processing pipeline 400 cannot access at an accelerated speed. Therefore, the TEXIN unit 404 overrules the configuration of the texture gather operation.

[0123] In yet another example, a stage of the texture processing pipeline 400 (e.g., the sampling control and address unit 408) may determine that a texture instruction includes floating-point texel coordinates representing precise integer coordinates. The stage may determine that a texture instruction with such texel coordinates is eligible for execution with eight threads per clock cycle.

[0124] Figure 5 is a flow chart of method steps for performing memory access operations in the texture processing pipeline 400 according to various embodiments. Figure 1-Figure 4 The method steps are described herein as a system with a method of performing the method steps, but one of ordinary skill in the art will understand that any system configured to perform the method steps in any order is within the scope of the present disclosure.

[0125] As shown, method 500 begins at step 502, where a first stage in texture processing pipeline 400 generates a first determination that a texture memory query is eligible for acceleration. In some embodiments, the first stage includes Figure 4The texture processing pipeline 400 of FIG. 4 is a TEXIO unit 402. The TEXIO unit 402 processes texture instructions, which include texture loads and texture operations. The TEXIO unit 402 receives texture instructions from the SM 310 for execution by the 32 threads in the warp. The TEXIO unit 402 divides the texture instructions into a plurality of portions, wherein each portion includes texture instructions for a subset of the threads in the warp. The TEXIO unit 402 analyzes the texture instruction opcode and certain parameters and modifiers of the texture instruction to make a first determination as to whether the texture instruction can be executed with four threads per clock cycle or with a higher number of threads per clock cycle.

[0126] Initially, the TEXIO unit 402 assumes that the texture instruction can be executed at a rate greater than four threads per clock cycle. If the TEXIO unit 402 determines that the texture instruction cannot be executed at an execution rate greater than four threads per clock cycle, the TEXIO unit 402, stage "overrules" the determination that the texture instruction can be executed at a rate according to the current configuration. The TEXIO unit 402 then reconfigures the instruction to execute at a lower rate. For example, the TEXIO unit 402 may overrule the configuration of the texture instruction to execute at eight threads per clock cycle, and reconfigure the texture instruction to execute at four threads per clock cycle.

[0127] If the TEXIO unit 402 determines that the texture instruction can only be executed with four threads per clock cycle, the TEXIO unit 402 splits the texture instruction into eight parts, each with four threads, and executes at a rate of four threads per clock cycle. If the TEXIO unit 402 determines that the texture instruction can be executed at a rate greater than four threads per clock cycle, such as with texture loading, the TEXIO unit 402 will split the texture instruction into multiple parts based on the value of "N". For example, if "N" = 2, the texture instruction that can be executed at a higher rate is split into four parts, each with eight threads, and the texture instruction is executed at a rate of eight threads per clock cycle. If "N" = 4, the texture instruction will be split into two parts per sixteen threads, and the texture instruction is executed at a rate of sixteen threads per clock cycle, and so on. For the following discussion, "N" is assumed to be 2. However, "N" can be any technically feasible number.

[0128] In some cases, the TEXIO unit 402 may not be able to determine whether the texture instruction can be executed with four threads per clock cycle or with eight threads per clock cycle based on the opcode. In this case, the TEXIO unit 402 splits the texture instruction into four parts, each with eight threads, and assumes that the texture instruction can be executed at a rate of eight threads per clock cycle. Subsequently, any other stage of the texture processing pipeline 400 can determine that the texture instruction cannot be executed under the current configuration. If the stage of the texture processing pipeline 400 determines that the texture instruction cannot be executed at the rate of the current configuration, the stage overrules the determination that the texture instruction can be executed at a rate according to the current configuration. The stage reconfigures the instruction to execute at a lower rate. For example, the stage can overrule the configuration of the texture instruction executed with eight threads per clock cycle, and reconfigure the texture instruction to execute with four threads per clock cycle.

[0129] At step 504, the first stage of the texture processing pipeline causes the texture memory query to proceed to the next stage in the texture processing pipeline 400. At step 506, the second stage in the texture processing pipeline 400 generates a second determination that the texture memory query is eligible for acceleration. In some embodiments, the second stage includes Figure 4 The TEXIN unit 404 of the texture processing pipeline 400 .

[0130] The TEXIN unit 404 receives the split texture instruction from the TEXIO unit 402. The TEXIN unit 404 retrieves the texture header state and the texture sampler state from the memory based on the texture header index and the texture sampler index included in the texture instruction. The texture header state and the texture sampler state are stored in a memory outside the texture processing pipeline 400. The TEXIN unit 404 stores the retrieved texture header state and the texture sampler state in a local memory cache. Each stage in the texture processing pipeline 400 retrieves the texture header state and the texture sampler state as needed to perform the operation of the stage. In addition, if a subsequent texture instruction includes the same texture header index and / or texture sampler index as the previous texture instruction, the TEXIN unit 404 can access the texture header state and the texture sampler state via the local memory cache. Accessing the texture header state and the texture sampler state via the local memory cache avoids retrieving the texture header state and the texture sampler state from the external memory when the state exists in the local memory cache.

[0131] The TEXIN unit 404 analyzes the texture header state and the texture sampler state associated with the texture instruction to make a second determination as to whether the texture instruction can be executed with eight threads per clock cycle or with four threads per clock cycle. If the TEXIN unit 404 determines that the incoming texture instruction configured to be executed with eight threads per clock cycle can only be executed with four threads per clock cycle, the TEXIN unit 404 overrules the configuration. The TEXIN unit 404 reconfigures the texture instruction to be executed with four threads per clock cycle.

[0132] For example, the TEXIN unit 404 may determine whether the texture instruction is a point sampling texture operation requesting the closest texture pixel based on the texture sampler state. If the texture instruction is a point sampling texture operation, the TEXIN unit 404 determines that the texture instruction can be executed with eight threads per clock cycle. On the other hand, the TEXIN unit 404 may determine that the texture instruction is associated with a more complex sampling or filtering operation based on the texture sampler state. In this case, the TEXIN unit 404 overrules the texture instruction and reconfigures the instruction to be executed with four threads per clock cycle. Similarly, if the texture header state data indicates that the texture instruction is for a texture including compressed data, the TEXIN unit 404 determines that the texture instruction can be executed with four threads per clock cycle.

[0133] At step 508, one or more stages in the texture processing pipeline 400 processes the texture memory query based on one or both of the first determination and the second determination. The method 500 then terminates.

[0134] In summary, various embodiments include a texture processing pipeline in a GPU that determines whether texture operations and texture loads can be processed at an accelerated rate at a first stage of the texture processing pipeline. The texture processing pipeline then reevaluates the decision at one or more additional stages of the texture processing pipeline. At each stage including a decision point, the texture processing pipeline assumes that the current texture operation or texture load can be accelerated unless specific, known information indicates that the texture operation or texture load cannot be accelerated. As the texture operation or texture load proceeds to different stages, the texture processing pipeline obtains additional information about the texture operation or texture load. The texture processing pipeline determines whether the texture operation and texture load can be processed at an accelerated rate at multiple stages. As a result, the texture processing pipeline increases the number of texture operations and texture loads that are accelerated relative to the number of texture operations and texture loads that are not accelerated.

[0135] At least one technical advantage of the disclosed technology over the prior art is that, with the disclosed technology, a greater percentage of texture memory access capabilities are used during texture loading and during simple texture operations. As a result, the efficiency and performance of texture processing hardware are improved during texture loading and texture operations over prior art approaches. Another technical advantage of the disclosed technology is that the texture processing hardware includes multiple stages for determining whether the memory access capabilities of the texture processing hardware can be used more efficiently. As a result, a greater number of texture loads and texture operations can utilize the disclosed technology over approaches that make this determination only at a single stage of the texture processing hardware. These advantages represent one or more technical improvements over prior art approaches.

[0136] Any and all combinations of any claim elements recited in any claim and / or any elements described in this application, in any manner, are within the intended scope of this disclosure and protection.

[0137] The description of various embodiments has been given for purposes of illustration, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments.

[0138] Aspects of the present embodiment may be embodied as a system, method, or computer program product. Therefore, aspects of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment (including firmware, resident software, microcode, etc.), or an embodiment incorporating software or hardware aspects that are generally referred to herein as a "module" or "system." In addition, aspects of the present disclosure may take the form of a computer program product embodied in one or more computer-readable media having computer-readable program code thereon.

[0139] Any combination of one or more computer-readable media may be utilized. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer-readable storage media would include the following: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this article, a computer-readable storage medium may be any tangible medium that may contain or store a program used by or in conjunction with an instruction execution system, device, or apparatus.

[0140] Various aspects of the present disclosure are described with reference to the flowchart illustrations and / or block diagrams of the methods, apparatus (systems) and computer program products according to the embodiments of the present disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams and the combination of blocks in the flowchart illustrations and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device can implement the flowchart and / or block diagrams. Figure 1 The functions / actions specified in one or more blocks. Such a processor may be, but is not limited to, a general-purpose processor, a special-purpose processor, an application-specific processor, or a field-programmable processor.

[0141] The flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a fragment or a portion of a code, which includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative embodiments, the functions recorded in the box may not occur in the order recorded in the figure. For example, depending on the functions involved, two boxes shown in succession can actually be executed substantially simultaneously, or sometimes these boxes can be executed in reverse order. It should also be noted that each box illustrated in the block diagram and / or flow chart, and the combination of boxes illustrated in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system or a combination of dedicated hardware and computer instructions that perform a specified function or action.

[0142] While the foregoing is directed to embodiments of the present disclosure, other and further embodiments of the disclosure may be devised without departing from the basic scope of the present disclosure, and the scope of the disclosure is determined by the claims that follow.

Claims

1. A computer-implemented method for accessing texture memory in a graphics processing unit, the method comprising: At a first stage in a texture processing pipeline, generating a first determination of whether a texture memory query is eligible for acceleration within the texture processing pipeline based on a first set of data; Based on the first determination, configuring the texture processing pipeline to process the texture memory queries at a first processing rate; causing the texture memory query to proceed to a second stage in the texture processing pipeline; generating, at the second stage in the texture processing pipeline, a second determination of whether the texture memory query is eligible for acceleration within the texture processing pipeline based on a second set of data, wherein the second set of data is different than the first set of data; Based on the second determination, the texture processing pipeline is reconfigured to process the texture memory queries at a second processing rate.

2. The computer-implemented method of claim 1, wherein the texture memory query is associated with a texture instruction, the texture instruction comprising a texture load of a single texel in texture memory.

3. The computer-implemented method of claim 1 , wherein the texture memory query is associated with a texture instruction, the texture instruction comprising a texture operation associated with a single texture element in texture memory that is closest to a location specified by the texture memory query. 4 . The computer-implemented method of claim 1 , wherein the texture memory query is associated with a texture memory instruction and the first determination is based on an opcode included in the texture memory instruction.

5. The computer-implemented method of claim 1 , wherein the texture memory query is associated with a texture memory instruction, and the first determination is based on identifying the texture memory instruction as an opcode for a texture load to a single texel in a texture memory, wherein the single texel is located at a memory address specified by the texture memory query.

6. The computer-implemented method of claim 1 , wherein the texture memory query is associated with a texture memory instruction, and at least one of the first determination or the second determination is based on an opcode that identifies the texture memory instruction as a texture operation on a single texel in a texture memory, wherein the single texel is closest to a memory address specified by the texture memory query.

7. The computer-implemented method of claim 1, wherein the texture memory query is associated with a texture memory instruction and the second determination is based on one or more of header state data or sampler state data associated with the texture memory instruction.

8. One or more non-transitory computer-readable media storing program instructions that, when executed by one or more processors, cause the one or more processors to perform the following steps: At a first stage in a texture processing pipeline, generating a first determination of whether a texture memory query is eligible for acceleration within the texture processing pipeline based on a first set of data; Based on the first determination, configuring the texture processing pipeline to process the texture memory queries at a first processing rate; causing the texture memory query to proceed to a second stage in the texture processing pipeline; generating, at the second stage in the texture processing pipeline, a second determination of whether the texture memory query is eligible for acceleration within the texture processing pipeline based on a second set of data, wherein the second set of data is different than the first set of data; Based on the second determination, the texture processing pipeline is reconfigured to process the texture memory queries at a second processing rate.

9. The one or more non-transitory computer-readable media of claim 8, wherein the texture memory query is associated with a texture memory instruction, and the first determination is based on an opcode included in the texture memory instruction.

10. The one or more non-transitory computer-readable media of claim 8, wherein the texture memory query is associated with a texture memory instruction, and the first determination is based on an opcode that identifies the texture memory instruction as a texture load for a single texel in a texture memory, wherein the single texel is located at a memory address specified by the texture memory query.

11. The one or more non-transitory computer-readable media of claim 8, wherein the texture memory query is associated with a texture memory instruction, and at least one of the first determination or the second determination is based on an opcode that identifies the texture memory instruction as a texture operation for a single texture element in a texture memory, wherein the single texture element is closest to a memory address specified by the texture memory query.

12. The one or more non-transitory computer-readable media of claim 8, wherein the texture memory query is associated with a texture memory instruction, and the second determination is based on one or more of header state data or sampler state data associated with the texture memory instruction.

13. The one or more non-transitory computer-readable media of claim 8, wherein the texture memory query is associated with a texture memory instruction and the second determination is based on a plurality of levels of detail included in the texture as specified by the head state data.

14. The one or more non-transitory computer-readable media of claim 8, wherein the texture memory query is associated with a texture memory instruction and the second determination is based on a size of a texture element specified by head state data.

15. The one or more non-transitory computer-readable media of claim 8, wherein based on at least one of the first determination and the second determination, texture memory instructions associated with the texture memory query are executed with a first number of threads per clock cycle or with a second number of threads per clock cycle.

16. A system comprising: a memory for storing instructions; as well as A processor coupled to the memory, the processor, when executing the instructions: At a first stage in a texture processing pipeline, generating a first determination of whether a texture memory query is eligible for acceleration within the texture processing pipeline based on a first set of data; Based on the first determination, configuring the texture processing pipeline to process the texture memory queries at a first processing rate; causing the texture memory query to proceed to a second stage in the texture processing pipeline; generating, at the second stage in the texture processing pipeline, a second determination of whether the texture memory query is eligible for acceleration within the texture processing pipeline based on a second set of data, wherein the second set of data is different than the first set of data; Based on the second determination, the texture processing pipeline is reconfigured to process the texture memory queries at a second processing rate.

17. The system of claim 16, wherein the texture memory query is associated with a texture instruction, the texture instruction comprising a texture load of a single texel in texture memory.

18. The system of claim 16, wherein the texture memory query is associated with a texture instruction, the texture instruction comprising a texture operation associated with a single texture element in texture memory that is closest to a location specified by the texture memory query.

19. The system of claim 16, wherein the texture memory query is associated with a texture gather operation, the texture gather operation comprising a texture operation associated with four adjacent texels in texture memory that are closest to a location specified by the texture memory query.

20. The system of claim 16, wherein the texture memory query is associated with a texture memory instruction, and the first determination is based on an opcode that identifies the texture memory instruction as a texture load for a single texel in a texture memory, wherein the single texel is located at a memory address specified by the texture memory query.