Load instructions for multisample anti-aliasing

A multi-sample anti-aliasing load instruction optimizes graphics processing by determining sampling rate and loading mode, enhancing cache efficiency and performance in graphics pipelines through SIMD parallel processing.

JP7793553B2Active Publication Date: 2026-01-05ADVANCED MICRO DEVICES INC
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2022578576
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-09-22
Filing Date
2021-06-08
Publication Date
2026-01-05
Estimated Expiration
2041-06-08

AI Technical Summary

Technical Problem

Existing 3D graphics processing pipelines face inefficiencies in performing multi-sample anti-aliasing operations, particularly in loading and processing high-resolution images for display, which can lead to suboptimal performance and resource utilization.

Method used

Implementing a multi-sample anti-aliasing load instruction that determines the sampling rate, data storage format, and loading mode to efficiently load data into vector registers, utilizing a single-instruction-multiple-data (SIMD) paradigm for parallel processing, allowing simultaneous loading of color or depth components based on the data organization and sampling rate.

Benefits of technology

Enhances cache efficiency and reduces cache evictions by loading multiple data elements simultaneously, improving performance and resource utilization in graphics processing pipelines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007793553000001
    Figure 0007793553000001
  • Figure 0007793553000002
    Figure 0007793553000002
  • Figure 0007793553000003
    Figure 0007793553000003
Patent Text Reader

Abstract

Techniques are provided for performing multi-sample anti-aliasing operations, including detecting an instruction for a multi-sample anti-aliasing load operation, determining a sampling rate of source data for the load operation, a data storage format of the source data, and a loading mode indicating whether the load operation requires same color components, different color components, or depth data, and determining load data from the multi-sample source to a register based on the determined sampling rate, data storage format, and loading mode.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] (CROSS-REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of U.S. Provisional Application No. 63 / 044,703, entitled "LOAD INSTRUCTION FOR MULTI SAMPLE ANTI-ALIASING," filed June 26, 2020, and U.S. Patent Application No. 17 / 028,811, entitled "LOAD INSTRUCTION FOR MULTI SAMPLE ANTI-ALIASING," filed September 22, 2020, the entire contents of which are incorporated herein by reference. [Background technology]

[0002] A three-dimensional ("3D") graphics processing pipeline performs a series of steps to convert input geometry into a two-dimensional ("2D") image for display on the screen. In multisample anti-aliasing, a high-resolution image is generated and then "resolved" into a lower-resolution image. Improvements to this technique are constantly being made.

[0003] A more detailed understanding may be had from the following description, given by way of example in conjunction with the accompanying drawings, in which: [Brief explanation of the drawings]

[0004] [Figure 1] FIG. 1 is a block diagram of an example device capable of implementing one or more features of the present disclosure. [Figure 2] FIG. 2 illustrates details of the device of FIG. 1, according to an example. [Figure 3] FIG. 3 is a block diagram illustrating additional details of the graphics processing pipeline shown in FIG. [Figure 4] FIG. 4 illustrates a multi-sample anti-aliasing load operation 400, according to an example. [Figure 5A]FIG. 10 illustrates a variation of the multi-sample load instruction. [Figure 5B] FIG. 10 illustrates a variation of the multi-sample load instruction. [Figure 5C] FIG. 10 illustrates a variation of the multi-sample load instruction. [Figure 5D] FIG. 5B is a diagram showing a data layout different from the data layouts shown in FIGS. 5A to 5C. [Figure 6] 6 is a flow diagram of a method 600 for performing a multi-sample anti-aliasing operation, according to an example. DETAILED DESCRIPTION OF THE INVENTION

[0005] Techniques are provided for performing multi-sample anti-aliasing operations, including detecting an instruction for a multi-sample anti-aliasing load operation, determining a sampling rate of source data for the load operation, a data storage format of the source data, and a loading mode indicating whether the load operation requires the same or different color component or depth data, and determining load data from the multi-sample source to a register based on the determined sampling rate, data storage format, and loading mode.

[0006] 1 is a block diagram of an example device 100 capable of implementing one or more features of the present disclosure. Device 100 may be, for example, but not limited to, a computer, a gaming device, a handheld device, a set-top box, a television, a mobile phone, a tablet computer, or any other computing device. Device 100 includes a processor 102, a memory 104, a storage device 106, one or more input devices 108, and one or more output devices 110. Device 100 also includes one or more input drivers 112 and one or more output drivers 114. Any input driver 112 may be embodied as hardware, a combination of hardware and software, or software, and is responsible for controlling (e.g., controlling the operation of, receiving input from, and providing data to) input driver 112. Similarly, any output driver 114 may be embodied as hardware, a combination of hardware and software, or software and serves to control (e.g., control the operation of, receive input from, and provide data to) output driver 114, output device 110. It should be understood that device 100 may include additional components not shown in FIG.

[0007] In various alternatives, processor 102 may include a central processing unit (CPU), a graphics processing unit (GPU), a CPU and a GPU located on the same die, or one or more processor cores, each of which may be a CPU or a GPU. In various alternatives, memory 104 may be located on the same die as processor 102 or may be located separately from processor 102. Memory 104 may include volatile or non-volatile memory (e.g., random access memory (RAM), dynamic RAM, cache).

[0008] Storage devices 106 include fixed or removable storage devices (e.g., but not limited to, hard disk drives, solid state drives, optical disks, flash drives). Input devices 108 include, but are not limited to, keyboards, keypads, touchscreens, touchpads, detectors, microphones, accelerometers, gyroscopes, biometric scanners, or network connections (e.g., wireless local area network cards for transmitting and / or receiving wireless IEEE 802 signals). Output devices 110 include, but are not limited to, displays, speakers, printers, haptic feedback devices, one or more optics, antennas, or network connections (e.g., wireless local area network cards for transmitting and / or receiving wireless IEEE 802 signals).

[0009] The input driver 112 and the output driver 114 include one or more hardware, software, and / or firmware components configured to interface with and drive the input device 108 and the output device 110, respectively. The input driver 112 communicates with the processor 102 and the input device 108, allowing the processor 102 to receive input from the input device 108. The output driver 114 communicates with the processor 102 and the output device 110, allowing the processor 102 to send output to the output device 110. The output driver 114 includes an accelerated processing device ("APD") 116 coupled to a display device 118, which in some examples is a physical display device or a simulated device that presents output using a remote display protocol. The APD 116 is configured to accept computational commands and graphics rendering commands from the processor 102, process the computational and graphics rendering commands, and provide pixel output to the display device 118 for display. As described in further detail below, APD 116 includes one or more parallel processing units configured to perform computations according to the single-instruction-multiple-data (SIMD) paradigm. Thus, although various functions are described herein as being performed by or in conjunction with APD 116, in various alternatives, functions described as being performed by APD 116 are additionally or alternatively performed by other computing devices having similar capabilities that are not driven by a host processor (e.g., processor 102) and that are configured to provide graphics output to display device 118. For example, it is contemplated that any processing system that performs processing tasks according to the SIMD paradigm may be configured to perform the functions described herein. Alternatively, it is contemplated that computing systems that do not perform processing tasks according to the SIMD paradigm perform the functions described herein.

[0010] 2 illustrates details of device 100 and APD 116, according to one example. Processor 102 (FIG. 1) executes operating system 120, drivers 122, and applications 126, and may alternatively or additionally execute other software. Operating system 120 controls various aspects of device 100, such as managing hardware resources, handling service requests, scheduling and controlling process execution, and performing other operations. APD driver 122 controls the operation of APD 116 and sends tasks, such as graphics rendering tasks or other work, to APD 116 for processing. APD driver 122 also includes a just-in-time compiler that compiles programs for execution by processing components of APD 116 (such as SIMD unit 138, described in more detail below).

[0011] APD 116 executes commands and programs for selected functions, such as graphics and non-graphics operations, that may be suitable for parallel processing. APD 116 may be used to perform graphics pipeline operations, such as pixel operations, geometry calculations, and rendering of images to display device 118, based on commands received from processor 102. APD 116 also performs computational operations not directly related to graphics operations, such as operations related to video, physics simulation, computational fluid dynamics, or other tasks, based on commands received from processor 102. In some examples, these computational operations are performed by executing computational shaders on SIMD unit 138.

[0012] The APD 116 includes a computation unit 132 that includes one or more SIMD units 138 configured to perform operations in a parallel manner according to the SIMD paradigm at the request of the processor 102 (or another unit). The SIMD paradigm is one in which multiple processing elements share a single program control flow unit and program counter, thus executing the same program but with different data. In one example, each SIMD unit 138 includes 16 lanes, each of which executes the same instruction simultaneously with other lanes in the SIMD unit 138 but can execute the instruction on different data. Lanes can be predictively switched off if not all lanes need to execute a given instruction. Prediction can also be used to execute programs with branching control flow. More specifically, for programs with conditional branches or other instructions where control flow is based on calculations performed by individual lanes, prediction of lanes corresponding to currently unexecuted control flow paths and serial execution of different control flow paths enables arbitrary control flow.

[0013] The basic unit of execution within the compute unit 132 is the work item. Each work item represents a single instantiation of a program executing in parallel on a particular lane. Work items can execute simultaneously (or partially concurrently and partially sequentially) as a “wavefront” on a single SIMD unit 138. One or more wavefronts are included in a “workgroup,” which contains a collection of work items designated to execute the same program. A workgroup can be executed by executing each of the wavefronts that make up the workgroup. In alternative examples, a wavefront executes on a single SIMD unit 138 or on different SIMD units 138. A wavefront can be thought of as the largest collection of work items that can execute simultaneously (or pseudo-simultaneously) on a single SIMD unit 138. “Pseudo-simultaneous” execution occurs when there are more wavefronts than the number of lanes in the SIMD unit 138. In such a situation, the wavefront executes over multiple cycles, with different collections of work items executing in different cycles. APD scheduler 136 is configured to perform operations related to scheduling various workgroups and wavefronts on compute units 132 and SIMD units 138 .

[0014] The parallel processing provided by the compute units 132 is well suited to graphics-related operations such as pixel value calculations, vertex transformations, and other graphics operations. Thus, in some cases, the graphics processing pipeline 134, which accepts graphics processing commands from the processor 102, provides computational tasks to the compute units 132 for execution in parallel.

[0015] Computation unit 132 is also used to perform computational tasks that are not related to graphics or that are not performed as part of the "normal" operation of graphics processing pipeline 134 (e.g., custom operations performed to supplement the operations performed on graphics processing pipeline 134). Applications 126 or other software executing on processor 102 send programs defining such computational tasks to APD 116 for execution.

[0016] Figure 3 is a block diagram illustrating additional details of the graphics processing pipeline 134 shown in Figure 2. The graphics processing pipeline 134 includes stages, each of which performs a particular functionality of the graphics processing pipeline 134. Each stage may be implemented partially or completely as a shader program executing within the programmable compute unit 132, or partially or completely as fixed-function, non-programmable hardware external to the compute unit 132.

[0017] The input assembler stage 302 reads user-filled buffers (e.g., buffers filled with requests from software executed by the processor 102, such as applications 126) and assembles the data into primitives for use by the rest of the pipeline. The input assembler stage 302 can generate different types of primitives based on the primitive data contained in the user-filled buffers. The input assembler stage 302 formats the assembled primitives for use by the rest of the pipeline.

[0018] The vertex shader stage 304 processes the vertices of the primitives assembled by the input assembler stage 302. The vertex shader stage 304 performs various per-vertex operations such as transformation, skinning, morphing, and per-vertex lighting. Transformation operations include various operations for transforming the coordinates of vertices. These operations include one or more of modeling transformations, viewing transformations, projection transformations, perspective division, viewport transformations that modify vertex coordinates, and other operations that modify non-coordinate attributes.

[0019] The vertex shader stage 304 is implemented partially or completely as a vertex shader program that runs on one or more compute units 132. The vertex shader program is provided by the processor 102 and is based on a program pre-written by a computer programmer. The driver 122 compiles such a computer program to generate a vertex shader program having a form suitable for execution within the compute units 132.

[0020] The hull shader stage 306, tessellator stage 308, and domain shader stage 310 work together to implement tessellation, which converts simple primitives into more complex primitives by subdividing the primitives. The hull shader stage 306 generates patches for tessellation based on the input primitives. The tessellator stage 308 generates a sample set for the patch. The domain shader stage 310 calculates vertex positions for vertices corresponding to the samples in the patch. The hull shader stage 306 and domain shader stage 310 can be implemented as shader programs executed on the compute unit 132 that are compiled by the driver 122 along with the vertex shader stage 304.

[0021] The geometry shader stage 312 performs vertex operations on a primitive basis. A variety of different types of operations can be performed by the geometry shader stage 312, including operations such as point sprite expansion, dynamic particle system operations, fur-fin generation, shadow volume generation, single pass render-to-cubemap, per-primitive material swapping, and per-primitive material setup. In some cases, the operations of the geometry shader stage 312 are performed by a geometry shader program compiled by the driver 122 and executed on the compute unit 132.

[0022] The rasterizer stage 314 accepts and rasterizes simple primitives (triangles) generated upstream from the rasterizer stage 314. Rasterization involves determining which screen pixels (or sub-pixel samples) are covered by a particular primitive. Rasterization is performed by fixed-function hardware.

[0023] The pixel shader stage 316 calculates the output values ​​of the screen pixels based on the primitives generated upstream and the results of rasterization. The pixel shader stage 316 can apply textures from texture memory. The operations of the pixel shader stage 316 are performed by pixel shader programs compiled by the driver 122 and executed on the compute unit 132.

[0024] The output merge stage 318 accepts the outputs from the pixel shader stage 316 and merges them into a target surface, performing operations such as z-testing and alpha blending to determine the final color of the screen pixel. The target surface is the final target for a frame of rendering operations in the graphics processing pipeline 134. The target surface may be located anywhere in memory (such as in the memory of the APD 116 or in memory 104).

[0025] The rasterizer stage 314 accepts triangles from the previous stage and performs scan conversion on the triangles to generate fragments. A fragment is data for an individual pixel of the render target and includes information such as position, depth, and coverage data, and later, after the pixel shader stage, shading data such as color. The render target is the destination image to which rendering is occurring (i.e., color or other values ​​are being written). If the render target is a multi-sample image, each pixel has multiple sample locations. The fragments generated by the rasterizer stage 314 are sent to the pixel shader stage 316, which determines color values ​​for the fragments and may also determine other values.

[0026] FIG. 4 illustrates a multisample anti-aliasing load operation 400, according to one example. Anti-aliasing is a technique in which data is generated for each of multiple samples for each pixel of a multisample render target. While it can be performed in any manner (e.g., by software, hardware circuitry, or a combination thereof), in some embodiments, a multisample decomposition operation performed by a shader program executing on compute unit 132 downsamples the information in the multisample render target to generate a full-resolution image. In one example where the multisample rate is 4x, graphics processing pipeline 134 generates a multisample image having four samples per pixel. The multisample decomposition operation then downsamples the multisample image to generate a full-resolution image. The number of samples in each pixel of the full-resolution image is one-quarter the number of samples in the multisample render target. The term "sample" includes one or more of color information (including one or more color components), depth information, and / or other information. In some examples, a sample in a multisample image has four color components and one depth component.

[0027] As described elsewhere, the compute unit 132 includes a SIMD unit 138 that operates in a single-instruction, multiple-data fashion. More specifically, in any given clock cycle, each active lane 402 executes the same instruction as all other lanes 402 in the SIMD unit 138. Thus, if a SIMD unit 138 performs a multi-sample load operation, each active lane 402 of the SIMD unit 138 performs that load operation.

[0028] For any particular lane 402, the load operation involves fetching multiple elements 408 for one or more samples from the cache 404 into a vector register for each lane 402. Several different versions of the multi-sample load operation are disclosed herein. Generally, these different versions vary based on what data is requested. In some examples, a single load operation for a single lane 402 loads the same color component for different samples (e.g., "R" in the case of an "RGB" color scheme) into a single vector register 406 for the lane 402. In other examples, a single load operation for a single lane 402 loads multiple (e.g., all) color components for a single sample into the vector register 406 for that lane 402. In yet other examples, a single load operation for a single lane 402 loads one depth value for multiple samples into the vector register 406 for that lane 402. In each case, element 408 refers to an individual data element (e.g., a color component or depth value) loaded by the load operation.

[0029] The illustrated cache 404 is a cache in the memory hierarchy from which SIMD unit 138 fetches data into registers such as vector registers 406. In various examples, cache 404 is within SIMD unit 138, within compute unit 132 but external to SIMD unit 138, or within APD 116 but external to compute unit 132. It should be understood that a miss in cache 404 results in the cache performing a cache linefill from higher in the memory hierarchy.

[0030] In summary, a multisample antialiasing load is an instruction executed by each active lane 402 of the SIMD unit 138. The instruction is performed at the request of a shader program executing on the SIMD unit 138. For any particular lane 402, the instruction specifies which elements of the multisample surface are to be loaded into the vector register 406 associated with that lane 402. In some examples, the elements loaded into one lane 402 are the same color components from different samples within the same pixel. In other examples, the elements are different color components from the same sample within a pixel. In other examples, the elements are depth values ​​for different samples within the same pixel. The load instruction includes an indication of whether color or depth components are to be loaded, and whether the same or different color components are to be loaded. Based on the sampling rate of the surface and the organization of the stored data, the SIMD unit 138 selects a stride and loads the requested elements into the vector register 406 based on the stride.

[0031] In situations where a load operation loads the same components for different samples of a pixel, the number of samples for each pixel may differ in some circumstances from the number of elements actually loaded by a particular load operation, which may in some instances be determined by the size of the vector register 406 destination relative to the size of the color components. For example, if the size of the vector register 406 is equal to the size of four elements, the load operation loads the elements. In situations where the number of samples is less than the number of elements to be loaded, the load operation loads the same components for different samples into a portion of the vector register 406. The load operation manipulates the remaining portion of the vector register 406 in any technically feasible manner, such as by repeating the elements actually loaded into that portion, storing a constant in that portion, or placing any other value in that portion of the vector register 406. In situations where the sampling rate is greater than the number of elements to be loaded, the load operation operates in two or more phases. In each phase, the same components are loaded for a different set of samples (e.g., samples 1 through 4, samples 5 through 8, etc.). In some embodiments, the load instruction includes a flag indicating the phase (thus allowing the programmer or other author of the program (which in some examples is a shader program) to specify which set of samples is loaded at any particular time). In other embodiments, a single load instruction specifies two or more vector registers 406, and SIMD unit 138 fetches the same color component for different sets of samples and sends the data to those two or more vector registers 406. This "phasing" also applies to depth buffer loads for sampling rates higher than the vector register size, for example, as shown in FIG. 5C.

[0032] Although the load operation 400 is shown in the context of the SIMD unit 138 and in the context of a SIMD process, operation of the load instruction outside of a SIMD context is also contemplated by this disclosure.

[0033] Figures 5A-5C show examples of multi-sample load instructions. Each of the operations shown in Figures 5A-5C assumes a data format for the color buffer (the source from which the color components are loaded) in which the color components for each individual sample are stored together in one contiguous chunk.

[0034] FIG. 5A illustrates an example including a multi-sample render target with four samples 502 per pixel 504. In a first example load operation—color buffer load—same component operation 506(1), SIMD unit 138 loads elements of the same color component for pixel 504. As described above, SIMD unit 138 selects a stride 508 based on the sample rate of the data from which the load is fetching elements and whether the load operation is for the same component or the same sample. The stride 508 indicates the number of elements in cache data set 510 that are advanced when retrieving elements for the load operation. In FIG. 5A, the number is four. This is because the illustrated cache data set 510(1) arranges the color data so that color components of the same pixel are in consecutive memory locations. Note that color components are denoted with the notation SXCY, where X is the sample number and Y is the component number. A stride 508 of four allows load operation 506(1) to collect each of the same components for four different samples.

[0035] In the second example, color buffer load - same sample 506(2), the load has a stride of 1 because the components of each sample are contiguous. This allows the load to retrieve all components of a single sample 502, and again, the color data is arranged as shown.

[0036] In a third example, depth buffer load 507(1), the stride is 1 because the depth data has only one component. Thus, depth buffer load 507(1) loads depth data for four different samples in a single instruction.

[0037] 5B shows a different exemplary mode of operation in which each pixel 524 has two samples 522 instead of four (i.e., the sampling rate is 2x). In this mode of operation, color buffer load operation - same component 526(1) has a stride of four because this operation obtains the same color component from different samples and the format of the data being loaded is such that different color components of the same sample are contiguous in memory. However, because there are only two samples in a pixel, load operation 526(1) obtains only two color components instead of four. When writing data to vector register 406, in various embodiments, load operation 526(1) repeats the two components of the data, fills two elements of vector register 406 with zeros or another constant, or places any other data into those two elements.

[0038] Color buffer load - loads successive data items of the same sample 526(2). In the illustrated example, these successive data items are the four color components for a single sample 522. Depth buffer load operation 527(1) loads successive depth values, one for each sample, as shown.

[0039] FIG. 5C illustrates another example where each pixel has eight samples 522. In this example, a color buffer load operation that loads the same number of elements into a vector register 406 of the same size as in the four-sample and two-sample examples cannot load all of the same components for each sample in the pixel into such a vector register 406. Therefore, the load operation operates in two distinct phases. In the first phase, labeled Color Buffer Load - Same Component, load operation 546(1) loads the same color component for the first four samples 522. In the second phase, labeled Color Buffer Load - Same Component, load operation 546(2) loads the same color component for a second set of different samples. In the illustrated example, load operation 546(1) loads color component C1 for samples S1-S4, and load operation 546(2) loads color component C1 for samples S5-S8. Load operation 546(1) and load operation 546(2) each have a stride of 4, reflecting that for each element retrieved by load operation 546, four components are skipped, resulting in the same components being loaded for each sample.

[0040] Color buffer load - For the same sample 546(3), load operation 546(3) loads using a stride of 1, which means that consecutive color components are loaded as shown.

[0041] For depth buffer loading, two phases are shown. In one mode, depth buffer loading, first phase 547(1), load instruction 547(1) loads depth components of a first set of samples using a stride of 1. In another mode, depth buffer loading, second phase 547(2), load instruction 547(2) loads depth components of a second set of samples using a stride of 1. In the example, the first set of samples are samples S1-S4 and the second set of samples are samples S5-S8.

[0042] Figure 5D illustrates a different data layout 560 than that shown in Figures 5A-5C. Instead of the data set being arranged so that all color components of a single sample are contiguous, in Figure 5D the same color component is contiguous for different samples. It should be understood that the example in Figure 5D is for a four sample render target and that other sampling rates are of course possible.

[0043] The ordering of data in data set 560 in FIG. 5D illustrates that the versions of the load operations shown in FIGS. 5A-5C operate differently depending on how the data being loaded is organized. In FIG. 5A, load 506(1) operating with stride 4 using data as shown loads the same color components of different samples. However, when color load 506(1) operates with data as shown in FIG. 5D, load 506(1) instead fetches four color components of a single sample (and thus has a stride of 1). Similarly, load 506(2) operating with stride 1 fetches the same components of a single sample when operating on the data of FIG. 5D and therefore has a stride of 4.

[0044] It should be noted that the various numbers of items (e.g., color components, samples per pixel, vector register size, etc.) shown in FIGS. 5A-5D are exemplary in nature, and variations in one or more of these numbers are contemplated by this disclosure. For example, in some variations, the number of components of a sample color is different from four. In some variations, the number of elements (components or depth values) that can fit into vector register 406 is different from four. In some variations, sample rates other than 2x, 4x, or 8x are possible. Many other variations are possible. In some examples, the stride is other than four. For example, if there are five components per color and the components for each sample are contiguous in memory, then loads of the same color component in different samples have a stride of 5. In some examples, the stride in such a situation is equal to the number of components per color. In other examples where the load operation loads non-contiguous elements, the stride is set to match the spacing between those non-contiguous elements.

[0045] Note that the described load operation may, in some circumstances, gain cache efficiency compared to an operation in which individual samples or depth values ​​are loaded one at a time from the cache. More specifically, cache lines may be evicted during the load operation. Thus, the more data loaded simultaneously, the less cache evictions occur while the data is being loaded.

[0046] 6 is a flow diagram of a method 600 for performing a multi-sample anti-aliasing operation, according to an example. Although described with respect to FIGS. 1-5D, one skilled in the art will understand that any system configured to perform the steps of method 600 in any technically feasible order is within the scope of this disclosure.

[0047] Method 600 begins at step 602, in which a processor, such as SIMD unit 138, detects a multisample anti-aliasing load instruction. In various examples, the load instruction is part of an instruction set architecture for a processor, such as SIMD unit 138. More specifically, SIMD unit 138 executes a shader program that includes instructions, some of which are multisample anti-aliasing load instructions.

[0048] The multisample load operation specifies which buffer to load from, where the term "buffer" refers to a portion of memory that stores the data to be loaded. In some examples, the buffer is a render target that stores color data or that stores depth data. In some examples, the load operation explicitly specifies whether the data in the buffer is color data or depth data. In other examples, SIMD unit 138 determines whether the data in the buffer is color data or depth data by examining the buffer itself or metadata about the buffer.

[0049] In step 604, SIMD unit 138 determines the sampling rate of the source data for the load operation, the data storage format of the source data if color data is being loaded, and a loading mode indicating whether the load operation requests the same color components of different samples, different color components of the same sample, or depth data. The sampling rate is the number of samples per pixel. The data storage format indicates whether different color components of the same sample are contiguous or the same components of different samples are contiguous.

[0050] In step 606, SIMD unit 138 loads the data requested by the load operation based on the information determined in step 604. More specifically, SIMD unit 138 selects a stride based on the information, retrieves a data element based on the characteristics of the operation determined in step 604, and retrieves the element from memory based on the stride. Techniques for performing such loads based on this information are described above with respect to Figures 4-5D.

[0051] Once loaded, the data is used in any technically feasible manner. In one example, a shader program executing in SIMD unit 138 performs a decomposition operation to generate a lower-resolution image from a multi-sample image. In one example, each work item of the shader program (corresponding to lane 402) decomposes the four samples loaded by the load operation into a single sample. While any technique may be used, one exemplary technique includes averaging the loaded values.

[0052] Each of the illustrated functional units represents hardware circuitry configured to perform the operations described herein, software configured to perform the operations described herein, or a combination of software and hardware configured to perform the steps described herein. A non-exclusive list of such units includes storage 106, processor 102, output driver 114, APD 116, memory 104, input driver 112, input device 108, output device 110, display device 118, operating system 120, driver 122, application 126, APD scheduler 136, graphics processing pipeline 134, compute unit 132, SIMD unit 138, any stage of graphics processing pipeline 134, lanes 402 of SIMD unit 138, cache 404, and vector registers 406.

[0053] It should be understood that many variations are possible based on the disclosure herein, and although features and elements are described above in particular combinations, each feature or element can be used alone without other features and elements, or in various combinations with or without other features and elements.

[0054] The provided methods can be implemented in a general-purpose computer, processor, or processor core. Suitable processors include, by way of example, a general-purpose processor, a special-purpose processor, a conventional processor, a digital signal processor (DSP), multiple microprocessors, one or more microprocessors in association with a DSP core, a controller, a microcontroller, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) circuit, any other type of integrated circuit (IC), and / or a state machine. Such a processor can be fabricated by configuring a manufacturing process using the results of processed hardware description language (HDL) instructions and other intermediate data, such as a netlist (such instructions can be stored on a computer-readable medium). The result of such processing can be a mask work, which is used in subsequent semiconductor manufacturing processes to produce a processor implementing features of the present disclosure.

[0055] The methods or flow diagrams provided herein may be implemented in a computer program, software, or firmware embodied in a non-transitory computer-readable storage medium for execution by a general-purpose computer or processor. Examples of non-transitory computer-readable storage media include read-only memory (ROM), random-access memory (RAM), registers, cache memory, semiconductor memory devices, magnetic media (e.g., internal hard disks and removable disks), magneto-optical media, and optical media (e.g., CD-ROM disks and digital versatile disks (DVDs)).

Claims

1. 1. A method for performing a multi-sample anti-aliasing operation, comprising: Detecting an instruction for a multi-sample anti-aliasing load operation; determining a sampling rate of source data for the multisample anti-aliasing load operation, a data storage format of the source data, and a loading mode for the multisample anti-aliasing load operation, the loading mode indicating whether the multisample anti-aliasing load operation requires same color component, different color component, or depth data; loading data from a multi-sample source into a register based on the determined sampling rate, data storage format, and loading mode, wherein the loading includes, for each of a plurality of samples of a pixel, loading at least one color component or depth data of each sample of the multi-sample source into the register, the data including the same color component of each sample if the multi-sample anti-aliasing load operation requires the same color component, or including multiple color components of each sample if the multi-sample anti-aliasing load operation requires different color components; performing a decomposition operation using the loaded data; method.

2. the data storage format indicates, for each sample, that different color components of the sample are stored in consecutive locations; 10. The method of claim 1.

3. the loading mode indicates that the multisample anti-aliasing load operation requires the same color component; loading data from the multi-sample source includes loading using a stride greater than 1. The method of claim 2.

4. the loading mode indicates that the multisample anti-aliasing load operation requires different color components of the same sample; loading data from the multi-sample source includes loading using a stride of one. The method of claim 2.

5. The data storage format indicates that the same color component is stored in consecutive locations among different samples of a pixel.

10. The method of claim 1.

6. the loading mode indicates that the multisample anti-aliasing load operation requires the same color component; loading data from the multi-sample source includes loading using a stride of one. The method of claim 5.

7. the loading mode indicates that the multisample anti-aliasing load operation requires different color components of the same sample; loading data from the multi-sample source includes loading using a stride greater than 1. The method of claim 5.

8. The method of claim 7, wherein loading the data includes loading less than all samples of a pixel into the register when a sampling rate of the source data is greater than the number of elements that can fit in the register.

10. The method of claim 1.

9. The method of claim 8, wherein loading the data includes repeating the loaded data in the register if a sampling rate of the source data is less than the number of elements that can fit in the register.

10. The method of claim 1.

10. 1. A system for performing multi-sample anti-aliasing operations, comprising: A register and a processor, The processor: Detecting an instruction for a multi-sample anti-aliasing load operation; determining a sampling rate of source data for the multisample anti-aliasing load operation, a data storage format of the source data, and a loading mode for the multisample anti-aliasing load operation, the loading mode indicating whether the multisample anti-aliasing load operation requires same color components, different color components, or depth data; loading data from a multi-sample source into a register based on the determined sampling rate, data storage format, and loading mode, wherein the loading includes, for each of a plurality of samples of a pixel, loading at least one color component or depth data of each sample of the multi-sample source into the register, the data including the same color component of each sample if the multi-sample anti-aliasing load operation requires the same color component, or including multiple color components of each sample if the multi-sample anti-aliasing load operation requires different color components; performing a decomposition operation using the loaded data; and configured to: system.

11. the data storage format indicates, for each sample, that different color components of the sample are stored in consecutive locations; The system of claim 10.

12. the loading mode indicates that the multisample anti-aliasing load operation requires the same color component; loading data from the multi-sample source includes loading using a stride greater than 1. The system of claim 11.

13. the loading mode indicates that the multisample anti-aliasing load operation requires different color components of the same sample; loading data from the multi-sample source includes loading using a stride of one. The system of claim 11.

14. The data storage format indicates that the same color component is stored in consecutive locations among different samples of a pixel. The system of claim 10.

15. the loading mode indicates that the multisample anti-aliasing load operation requires the same color component; loading data from the multi-sample source includes loading using a stride of one.

15. The system of claim 14.

16. the loading mode indicates that the multisample anti-aliasing load operation requires different color components of the same sample; loading data from the multi-sample source includes loading using a stride greater than 1.

15. The system of claim 14.

17. The method of claim 16, wherein loading the data includes loading less than all samples of a pixel into the register when a sampling rate of the source data is greater than the number of elements that can fit in the register. The system of claim 10.

18. The method of claim 17, wherein loading the data includes repeating the loaded data in the register if the sampling rate of the source data is less than the number of elements that can fit in the register. The system of claim 10.

19. 1. An accelerated processing device for performing multi-sample anti-aliasing operations, comprising: A register and a single instruction multiple data processing unit; The single instruction multiple data processing unit comprises: Detecting an instruction for a multi-sample anti-aliasing load operation; determining a sampling rate of source data for the multisample anti-aliasing load operation, a data storage format of the source data, and a loading mode for the multisample anti-aliasing load operation, the loading mode indicating whether the multisample anti-aliasing load operation requires same color components, different color components, or depth data; loading data from a multi-sample source into a register based on the determined sampling rate, data storage format, and loading mode, wherein the loading includes, for each of a plurality of samples of a pixel, loading at least one color component or depth data of each sample of the multi-sample source into the register, the data including the same color component of each sample if the multi-sample anti-aliasing load operation requires the same color component, or including multiple color components of each sample if the multi-sample anti-aliasing load operation requires different color components; performing a decomposition operation using the loaded data; and configured to: Accelerated processing device.

20. the data storage format indicates that, for each sample, different color components of the sample are stored in consecutive locations, or the data storage format indicates that the same color components are stored in consecutive locations between different samples of a pixel; 20. The accelerated processing device of claim 19.

Citation Information

Patent Citations

  • Edge multisampling hybrid Anti-alias

    JP2007018124A

  • Alternate reduction ratios and threshold mechanisms for framebuffer compression

    US20130249897A1

  • System, method, and computer program product for redistributing a multi-sample processing workload between threads

    US20150054836A1

  • Graphic processor unit and method of operating the same

    US20150091918A1

  • Compression Using Index Bits in MSAA

    US20160133029A1