CN100578542C - Graphics processing system and method for storing texture map data in the same - Google Patents
Graphics processing system and method for storing texture map data in the same Download PDFInfo
- Publication number
- CN100578542C CN100578542C CN200710123324A CN200710123324A CN100578542C CN 100578542 C CN100578542 C CN 100578542C CN 200710123324 A CN200710123324 A CN 200710123324A CN 200710123324 A CN200710123324 A CN 200710123324A CN 100578542 C CN100578542 C CN 100578542C
- Authority
- CN
- China
- Prior art keywords
- texture
- tile
- texture tile
- grade
- mip
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000012545 processing Methods 0.000 title abstract description 36
- 239000011449 brick Substances 0.000 claims description 24
- 238000004364 calculation method Methods 0.000 claims description 18
- 230000008569 process Effects 0.000 claims description 14
- 238000010586 diagram Methods 0.000 claims description 12
- 230000008520 organization Effects 0.000 claims description 3
- 238000013523 data management Methods 0.000 description 13
- 238000013507 mapping Methods 0.000 description 10
- 238000007726 management method Methods 0.000 description 9
- 230000006835 compression Effects 0.000 description 5
- 238000007906 compression Methods 0.000 description 5
- 238000001914 filtration Methods 0.000 description 5
- 230000000670 limiting effect Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 238000005070 sampling Methods 0.000 description 3
- 230000002776 aggregation Effects 0.000 description 2
- 238000004220 aggregation Methods 0.000 description 2
- 230000001934 delay Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000002401 inhibitory effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000002829 reductive effect Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
Images
Landscapes
- Image Generation (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
技术领域 technical field
本发明是关于图形处理,且特别是关于图形数据管理的系统以及方法。The present invention relates to graphics processing, and more particularly to systems and methods for graphics data management.
背景技术 Background technique
如已知的背景技术,计算机图形处理系统需处理大量数据,其中包括纹理(texture)数据。纹理为具有一(u,v)坐标空间的数字影像(通常为矩形的)。纹理的最小可定址单元为纹理元素(texel),根据其位置而被指派一特定(u,v)坐标。在纹理映射(mapping)运算中,纹理被映射至图解模型的表面来呈现模型以建立目的影像。在目的影像中,纹理元素位于(x,y)坐标系统中的特定坐标处。纹理映射的目的为在物件的表面上提供实际外观。As known in the background art, a computer graphics processing system needs to process a large amount of data, including texture data. Textures are digital images (usually rectangular) with a (u,v) coordinate space. The smallest addressable unit of a texture is a texel, which is assigned a specific (u, v) coordinate based on its position. In texture mapping operations, textures are mapped onto the surface of the graphical model to render the model to create the desired image. In the destination image, the texels are located at specific coordinates in the (x,y) coordinate system. The purpose of texture mapping is to provide a realistic appearance on the surface of an object.
纹理数据通常内存在系统存储器中,系统存储器为共用资源。在许多计算机系统中,其他元件可能尝试存取由图形处理系统使用的数据或利用共用的系统总线,两种情形可能会导致图形处理系统的数据存取时间增加。此外,请求来自系统存储器的数据出于其他原因可能会花费过量的时间。因此,存取系统存储器可能会对图形处理系统具有效能抑制效应。Texture data is usually stored in system memory, which is a shared resource. In many computer systems, other components may attempt to access data used by the graphics processing system or utilize a shared system bus, both of which may result in increased data access times for the graphics processing system. Additionally, requesting data from system memory may take an excessive amount of time for other reasons. Therefore, accessing system memory may have a performance-inhibiting effect on the graphics processing system.
在现代计算机图形中,纹理处理可包括许多不同类型的纹理映射技术,包括立方映射(cubic mapping)、mip映射(mipmapping)以及各种异性(anisotropic)映射。由于执行纹理处理所需的算术以及逻辑运算十分复杂以及大量,使得除了用于其他图形处理运算的电路之外,纹理处理专用电路的使用成为必要。因此,此等纹理处理专用电路可包括显着百分比的构成图形处理单元的硬件门(gate)。In modern computer graphics, texture processing can include many different types of texture mapping techniques, including cubic mapping, mipmapping, and various anisotropic mappings. Since the arithmetic and logical operations required to perform texture processing are very complex and numerous, it is necessary to use dedicated circuits for texture processing in addition to circuits for other graphics processing operations. Accordingly, such texture processing dedicated circuits may comprise a significant percentage of the hardware gates that make up a graphics processing unit.
纹理映射在计算与存储器存取上须需付出昂贵的代价。改良数据可存取性的一种技术为经由专用于储存纹理数据的纹理快取存储器,在数据需要进行纹理处理之前,将纹理数据自系统存储器提供给纹理快取存储器,借此提供图形系统所需的纹理数据,且减少对存取系统存储器的需要。此方式又可减少与存储器延迟(latency)相关的问题。然而,由于对纹理数据的管理以及储存并非十分有效率,所以即使使用纹理快取存储器,存储器延迟仍继续成为问题。因此,产业中存在对纹理像砖(tile)数据于存储器储存中改良的需要。Texture mapping is expensive in terms of computation and memory access. One technique to improve data accessibility is to provide texture data needed by the graphics system by providing texture data from system memory to the texture cache via a texture cache dedicated to storing texture data before the data needs to be textured. needed texture data and reduce the need to access system memory. This approach, in turn, reduces problems related to memory latency. However, memory latency continues to be an issue even with texture cache memory because the management and storage of texture data is not very efficient. Therefore, there is a need in the industry for improvements in memory storage of textured tile data.
发明内容 Contents of the invention
本发明揭露的实施例提供用于以纹理片为主的格式(slice-major format)压缩并储存纹理图数据(texture map data)的系统以及方法。The disclosed embodiments of the present invention provide a system and method for compressing and storing texture map data in a slice-major format.
本发明的一个实施例包括图形处理系统,其包括根据以纹理片为主的格式组织纹理图数据的纹理管理单元,其中纹理图数据至少跨越一个mip等级(mip level)。此外,图形处理系统还包括纹理快取存储器,其中纹理快取存储器耦接至纹理管理单元,且用以接收来自纹理管理单元的经重组的纹理图数据。其中所述纹理管理单元包括:纹理数据格式器,用以根据以纹理片为主的格式排列所述纹理图数据内的纹理片,其中具有相同mip等级的纹理片被分组并储存在一起,若具有相同mip等级的所有所述纹理片的总和小于一像砖的大小,则将具有所述相同mip等级的所述纹理片存储在所述像砖内;参数计算逻辑模块,用以计算所述纹理图数据内的每一纹理片的参数;以及地址计算逻辑模块,用以使用所述参数来计算所述纹理图数据内的每一纹理片的快取存储器地址。One embodiment of the invention includes a graphics processing system including a texture management unit that organizes texture map data according to a texture slice-based format, wherein the texture map data spans at least one mip level. In addition, the graphics processing system further includes a texture cache memory, wherein the texture cache memory is coupled to the texture management unit and is used for receiving reorganized texture map data from the texture management unit. The texture management unit includes: a texture data formatter, configured to arrange the texture slices in the texture map data according to the texture slice-based format, wherein the texture slices with the same mip level are grouped and stored together, if The sum of all the texture slices with the same mip level is less than the size of a brick, then the texture slices with the same mip level are stored in the brick; the parameter calculation logic module is used to calculate the parameters of each texture slice in the texture map data; and an address calculation logic module, configured to use the parameters to calculate a cache memory address of each texture slice in the texture map data.
本发明的另一实施例包括在图形处理器中储存纹理图数据的方法,且所述方法可通过以下步骤大致加以概括:根据mip等级将纹理图数据的纹理片分组,其中具有相同mip等级的纹理片被分组并储存在一起;若多个所述纹理片的大小的总和小于一像砖,则根据模式标志将多个纹理片排列在所述像砖中;计算关于每一mip等级的每一所述纹理片的参数;根据前一步骤所计算的参数计算纹理图数据内的每一纹理片的存储器地址;以及将经重组的纹理片储存在纹理快取存储器中。Another embodiment of the present invention includes a method for storing texture map data in a graphics processor, and the method can be roughly summarized by the following steps: grouping texture tiles of texture map data according to mip levels, wherein texture tiles with the same mip level Texture slices are grouped and stored together; if the sum of the size of a plurality of said texture slices is less than a tile, then a plurality of texture slices are arranged in said tiles according to the mode flag; calculate each mip level about each a parameter of the texture slice; calculating a memory address of each texture slice in the texture map data according to the parameters calculated in the previous step; and storing the reorganized texture slice in the texture cache memory.
本发明的又一实施例包括在图形处理器中储存纹理图数据的方法,且所述方法可通过以下步骤大致加以概括:用以纹理片为主的格式重组纹理图数据的纹理片,其中具有相同细节等级的纹理片被分组并储存在一起;若具有相同细节等级的所有纹理片的总量小于像砖的大小,则将具有相同细节等级的纹理片储存在同一像砖内;计算关于每一纹理片的参数,其中这些参数是针对每一细节等级来计算;基根据所计算的参数计算纹理图数据内的每一纹理片的新存储器地址;以及将经重组的纹理片以及新存储器地址储存在纹理快取存储器中。Yet another embodiment of the present invention includes a method of storing texture map data in a graphics processor, and the method can be broadly summarized by the following steps: recombining texture tiles of texture map data into a texture tile-based format, wherein Texture slices with the same level of detail are grouped and stored together; if the total amount of all texture slices with the same level of detail is smaller than the size of the tile, then the texture slices with the same level of detail are stored in the same tile; calculations for each parameters of a texture slice, wherein these parameters are calculated for each level of detail; a new memory address for each texture slice in the texture map data is calculated based on the calculated parameters; and the restructured texture slice and the new memory address Stored in texture cache.
在检查以下图式以及实施方式时,本发明的其他系统、方法、特征以及益处将对于本领域技术人员为显而易见的或变得显而易见。所有此等额外系统、方法、特征以及益处是意图被包括在此描述内,在本发明的范畴内,且通过随附权利要求书加以保护。Other systems, methods, features and benefits of the invention will be, or become, apparent to one with skill in the art upon examination of the following figures and implementation. It is intended that all such additional systems, methods, features and benefits be included within this description, be within the scope of the invention, and be protected by the following claims.
附图说明 Description of drawings
图1为多图形处理器系统的实施例的方块图。FIG. 1 is a block diagram of an embodiment of a multi-GPU system.
图2说明计算机图形系统内的纹理数据管理的某些基本元件。Figure 2 illustrates some basic elements of texture data management within a computer graphics system.
图3为说明例示性L2快取存储器组织格式的方块图。3 is a block diagram illustrating an exemplary L2 cache memory organization format.
图4说明例示性32位纹理像砖。FIG. 4 illustrates an exemplary 32-bit texture image tile.
图5描绘用于执行像砖纹理数据的以纹理片为主的压缩方法的实施例的流程图。Figure 5 depicts a flowchart of an embodiment of a method for performing texture tile-based compression of brick-like texture data.
图6A说明用于图5中的实施例的模式0。FIG. 6A illustrates
图6B说明用于图5中的实施例的模式1。FIG. 6B illustrates
图7描绘用以纹理片为主的格式将体积纹理贴图储存在纹理快取存储器内的实施例。FIG. 7 depicts an embodiment of storing volumetric texture maps in a texture cache in a texture tile-based format.
图8描绘用于执行像砖纹理数据的以纹理片为主的压缩方法的另一实施例的流程图。Figure 8 depicts a flowchart of another embodiment of a method for performing texture tile-based compression of brick-like texture data.
具体实施方式 Detailed ways
在概括了本发明的各种观点之后,现将详细参看如图式中所说明的本发明的描述。虽然将结合此等图式来描述本发明,但是不意欲将本发明限制于本文所揭露的一或多个实施例。而是意欲涵盖包括在由随附权利要求书界定的本发明的精神以及范畴内的所有替代、修改以及均等物。Having summarized various aspects of the invention, reference will now be made in detail to the description of the invention as illustrated in the drawings. While the invention will be described in conjunction with the drawings, it is not intended to limit the invention to the one or more embodiments disclosed herein. Rather, it is intended to cover all alternatives, modifications and equivalents as included within the spirit and scope of the invention as defined by the appended claims.
本发明所揭露的系统以及方法可用于有效地管理并组织纹理数据,以使(例如)纹理过滤器处理时所需的任何纹理数据在图形处理系统中可易于撷取。通常,自系统存储器接收众多不同格式以及大小的纹理数据,若未虑及此数据的大小或组成方式可能会导致纹理快取存储器资源的使用上较无效率。此种无效率的导因之一为在撷取纹理数据时存在过多延迟。可理解地,撷取纹理像砖数据(texture tiling data)的延迟导致在处理此数据中的延迟。因此存在更有效率地储存纹理像砖数据的系统以及方法的需要,以达到在计算机图形环境中快速处理图形数据。The systems and methods disclosed herein can be used to efficiently manage and organize texture data such that any texture data required, for example, for texture filter processing can be easily retrieved in a graphics processing system. Often, many different formats and sizes of texture data are received from system memory, and failure to take into account the size or composition of the data may result in an inefficient use of texture cache memory resources. One reason for this inefficiency is that there is too much delay in fetching texture data. Understandably, delays in retrieving texture tiling data cause delays in processing this data. Therefore, there is a need for a system and method for storing texture-like brick data more efficiently, so as to achieve fast processing of graphics data in a computer graphics environment.
因此,本发明揭露根据以纹理片为主的格式压缩并储存纹理图数据的系统以及方法。mip贴图(mipmap)通常是指伴随主要纹理的影像的预定聚集。此等影像的预定聚集仅为主要纹理较低分辨率的复本。当自一距离观察特定物件以致物件以及周围纹理变得更小时,mip贴图为有用的。当观察物件的较小版本时,可基于分辨率等级来切换至一适合的mip贴图影像,以呈现适合等级的纹理分辨率。与实时计算相比,由于仅需简单地查找预定影像,所以使用mip贴图减少了再现物件所需的时间。Therefore, the present invention discloses a system and method for compressing and storing texture map data according to a texture tile-based format. A mipmap generally refers to a predetermined aggregation of images that accompany a primary texture. The intended aggregation of these images is simply a lower resolution replica of the main texture. Mipmaps are useful when viewing a particular object from a distance such that the object and surrounding textures become smaller. When viewing a smaller version of an object, based on the resolution class, switch to an appropriate mipmap image to render the appropriate texture resolution for the class. Compared to real-time calculations, using mipmaps reduces the time required to render an object by simply looking up a predetermined image.
mip贴图链内的每一mip等级皆被指派一细节等级(level ofdetail,LOD)值,以指示分辨率等级。LOD值越高,影像越小且分辨率越低。意即,随着物件距离观察者越来越远,物件的复杂度随之(例如在纹理中)变小。出于本发明所使用的命名法的目的,术语“细节等级”以及术语“mip等级”之间可互换地使用。对于给定显示,可能必须储存多个表面。此等表面的每一个以连续方式加以储存。此外,此等表面的纹理图数据可以若干方法加以储存。举一非限制性实例,可根据“以mip为主”的格式储存纹理数据。亦即,纹理数据的纹理片的组织方式是将每一mip等级的第一个纹理片(例如,纹理片0)储存在一起。因此,mip等级1的纹理片0、mip等级2的纹理片0、mip等级3的纹理片0等皆以连续方式储存在一起。此过程延续至所有mip等级的下一纹理片(例如纹理片1),等等。或者,可根据mip等级或用“以纹理片为主”的格式储存纹理数据。因此,mip等级1的纹理片0、mip等级1的纹理片1、mip等级1的纹理片2等皆储存在一起。意即,具有相同mip等级的所有纹理片皆以连续的方式储存在一起。此过程延续至下一最高mip等级的所有纹理片,等等。Each mip level within a mipmap chain is assigned a level of detail (LOD) value to indicate the resolution level. The higher the LOD value, the smaller the image and the lower the resolution. That is, as the object is farther away from the viewer, the complexity of the object (eg in texture) becomes smaller. For the purposes of the nomenclature used herein, the term "level of detail" and the term "mip level" are used interchangeably between. For a given display, multiple surfaces may have to be stored. Each of these surfaces is stored in a continuous fashion. Furthermore, texture map data for such surfaces can be stored in several ways. As a non-limiting example, texture data may be stored according to a "mip-based" format. That is, the texture slices of the texture data are organized in such a way that the first texture slice (eg, texture slice 0) of each mip level is stored together. Therefore,
通常纹理图数据是根据以mip为主的格式来储存。本发明的实施例集中在用“以纹理片为主”的格式储存纹理数据的方法上。如本文进一步描述,本发明的实施例通过将数据“挤压”或压缩在一起,以使得较小的纹理片不占据纹理快取存储器内的整个纹理像砖,进而增加了撷取纹理数据的效率,借此避免浪费存储器空间。Usually texture map data is stored according to the mip-based format. Embodiments of the present invention focus on methods for storing texture data in a "texture tile-based" format. As further described herein, embodiments of the present invention increase the throughput of retrieving texture data by "squeezing" or compressing the data together so that smaller texture tiles do not occupy an entire texture tile in texture cache memory. Efficiency, thereby avoiding wasting memory space.
通常,纹理片是指用于再现3D物件的2D影像。纹理元素(texel)为影像中的2D点,且为用于图形处理的纹理空间的基础构建块(building block)。纹理元素通常通过两个坐标(u以及v)来定址。纹理通常通过纹理元素的阵列来表示。在纹理映射过程中,会进行纹理寻找以找出每一纹理元素中心落在纹理上的何处。因为纹理化表面相对于观察者可能在任意距离以及方位处,所以一像素通常不直接对应于一纹理元素,必须应用某种过滤形式来确定像素的最佳色彩,然而无效或不正确的过滤将呈现出如加工过的影像。Generally, texture slices refer to 2D images used to reproduce 3D objects. A texel is a 2D point in an image and is the basic building block of a texture space for graphics processing. A texel is usually addressed by two coordinates (u and v). Textures are usually represented by arrays of texels. During texture mapping, a texture seek is performed to find out where the center of each texel falls on the texture. Because a textured surface may be at any distance and orientation relative to the viewer, a pixel does not usually correspond directly to a texel, and some form of filtering must be applied to determine the best color for the pixel, however ineffective or incorrect filtering will Appears as a processed image.
通常,在讨论体积(volume)纹理映射机制时,若干属性为常见的。首先,当再现体积纹理时,通常在逐片的基础上分别地再现每一纹理片。当读取一体积纹理时,通常以随机方式执行关于纹理表面的移动方向。当指定纹理样本时,将三个坐标指派给3D(三维)纹理(亦即,体积纹理)。坐标在三个维度的每一个中的改变在机率上通常相等。因此,物件移动穿过一给定纹理片的机率通常与物件在同一纹理片内移动的机率相同。作为说明,假设一3D纹理通过(u,v,r)坐标空间来界定,u以及v方向上的改变会导致需在给定纹理片内作采样,而r方向上的改变会导致需横跨多个纹理片作采样。因此,将处于相同mip等级的邻接的纹理片彼此尽可能紧密地储存在快取存储器内为较佳的作法,以便允许更有效的数据撷取。理想地,此等邻接纹理片会储存在纹理快取存储器内的同一快取页(page)中,且甚至在同一快取线(line)内。通常,特定纹理表面的不同视图将涵盖某数量的纹理片以及mip等级。因此,一视图的产生可通过包括跨越某数目的mip等级的纹理片的再现目标阵列来建立。作为非限制性实例,某一视图可能包括纹理片0至纹理片5以及mip等级1至3。因此,此视图涵盖在六个纹理片且跨越三个不同的mip等级。为帮助确保可通过某整数的纹理片以及某整数的mip等级截取特定视图,纹理数据会储存为2D(二维)mip贴图的阵列。此外,纹理数据会整理为根据mip等级将纹理片分组在一起且加以储存。因此,处于某一给定mip等级的所有纹理片会储存在一起,且处于下一较低mip等级的所有纹理片也会被分组并储存在一起。以此方式,用“以纹理片为主”的格式储存纹理片。虽然三个维度(x,y,z)上所包括的纹理片以及所跨越的mip等级的数目为任意,但是经mip映射的体积纹理通常为2维的某次幂(power)。作为实例,体积纹理图可能为2048×2048×2048或211×211×211像素。本文所描述的某些实施例的至少一个益处为纹理数据根据以上所论述的特性可受到较佳的管理以及储存。In general, when discussing volume texture mapping mechanisms, several properties are common. First, when rendering volumetric textures, each texture slice is typically rendered separately on a slice-by-slice basis. When reading a volumetric texture, the direction of movement with respect to the textured surface is usually performed in a random fashion. When specifying a texture sample, three coordinates are assigned to a 3D (three-dimensional) texture (that is, a volume texture). Coordinates change in each of the three dimensions with generally equal chances. Thus, the probability of an object moving through a given tile is generally the same as the probability of an object moving within the same tile. As an illustration, assuming a 3D texture is defined by a (u, v, r) coordinate space, changes in the u and v directions will result in sampling within a given texture slice, while changes in the r direction will require sampling across Multiple texture slices for sampling. Therefore, it is preferable to store adjacent texture tiles at the same mip level as close as possible to each other in cache memory to allow more efficient data retrieval. Ideally, these contiguous texture tiles would be stored in the same cache page in the texture cache, and even in the same cache line. Typically, different views of a particular textured surface will cover some number of texture slices and mip levels. Thus, the generation of a view may be created by a rendering target array comprising texture tiles spanning a certain number of mip levels. As a non-limiting example, a certain view might include texture slices 0-5 and mip levels 1-3. Thus, this view is spanned across six texture slices and spans three different mip levels. To help ensure that a specific view can be captured with an integer number of texture slices and an integer number of mip levels, the texture data is stored as an array of 2D (two-dimensional) mipmaps. Additionally, texture data is organized into texture tiles grouped together by mip level and stored. Thus, all texture tiles at a given mip level are stored together, and all texture tiles at the next lower mip level are also grouped and stored together. In this way, texture tiles are stored in a "texture tile-based" format. Although the number of included texture tiles and spanned mip levels in the three dimensions (x, y, z) is arbitrary, mip-mapped volumetric textures are usually some power of 2 dimensions. As examples, a volumetric texture map might be 2048x2048x2048 or 211x211x211 pixels. At least one benefit of certain embodiments described herein is that texture data can be better managed and stored according to the characteristics discussed above.
现参看图1,其说明计算机系统100的简化方块图。计算机系统100包括CPU 102、系统存储器104以及图形处理系统110。CPU 102可执行各种功能,包括确定可产生图形显示的信息(诸如观察点位置)。系统存储器104储存各种数据,包括诸如纹理数据106之类的图形显示数据。基于CPU 102所确定的信息以及在系统存储器104中所储存的数据,图形处理系统110产生用于显示装置130(诸如,监视器)的显示数据。纹理映射用于对物件添加纹理。图形处理系统110再现3D物件的纹理片,纹理片基本上经“堆叠”起来以形成物件。一旦建立了3D纹理,便将纹理添加至物件以形成影像,借此使物件得以纹理化。Referring now to FIG. 1 , a simplified block diagram of a computer system 100 is illustrated. Computer system 100 includes CPU 102, system memory 104, and graphics processing system 110. CPU 102 can perform various functions, including determining information (such as viewpoint location) that can generate a graphical display. System memory 104 stores various data, including graphics display data such as texture data 106 . Based on information determined by CPU 102 and data stored in system memory 104, graphics processing system 110 generates display data for display device 130, such as a monitor. Texture maps are used to add texture to objects. Graphics processing system 110 renders texture tiles of a 3D object, which are essentially "stacked" to form the object. Once the 3D texture is created, the object is textured by adding the texture to the object to form an image.
CPU 102经由系统接口108向图形处理系统110提出请求,包括处理并显示图形信息的请求。来自CPU 102的图形请求由图形处理系统110接收并提供给前端(front end)处理器112,前端处理器112产生含有像素坐标的像素流。The CPU 102 sends requests to the graphics processing system 110 via the system interface 108, including requests for processing and displaying graphics information. Graphics requests from CPU 102 are received by graphics processing system 110 and provided to front end processor 112, which generates a pixel stream containing pixel coordinates.
前端处理器112产生的关于像素坐标的信息经由纹理数据管理单元114以及纹理快取存储器系统116提供至纹理过滤器118。纹理数据管理单元114自前端处理器112接收信息,且在将数据发送至纹理快取存储器系统116以在储存之前组织数据。Information about pixel coordinates generated by the front-end processor 112 is provided to the texture filter 118 via the texture data management unit 114 and the texture cache system 116 . Texture data management unit 114 receives information from front end processor 112 and sends the data to texture cache system 116 to organize the data prior to storage.
纹理过滤器118随后通过执行(例如)双线性过滤、三线性过滤或其组合来过滤信息且产生每一像素的纹理数据。除已知纹理过滤器元件(诸如线性内插器以及累加器)之外,纹理过滤器118亦包括可程序化表过滤器(table filter)以结合其他纹理过滤器元件来提供特定过滤操作。纹理数据为发送至帧缓冲器120的最终色彩数据的分量,其用于在显示装置130上产生显示影像。Texture filter 118 then filters the information and generates texture data for each pixel by performing, for example, bilinear filtering, trilinear filtering, or a combination thereof. In addition to known texture filter elements such as linear interpolators and accumulators, texture filter 118 also includes programmable table filters to provide specific filtering operations in conjunction with other texture filter elements. Texture data is a component of the final color data sent to frame buffer 120 for use in generating a display image on display device 130 .
纹理快取存储器系统116可包括多个快取存储器,包括(例如)等级1(L1)快取存储器以及等级2(L2)快取存储器。纹理信息是以各个纹理元素而加以储存,纹理元素在图形处理期间用于界定在像素坐标处显示的色彩数据。纹理数据自系统存储器104流至纹理数据管理单元114,且随后流至纹理快取存储器系统116,再流至纹理过滤器118。应注意对于某些实施例,纹理数据管理单元114可整合在纹理快取存储器系统116中。The texture cache system 116 may include multiple caches, including, for example, a level 1 (L1) cache and a level 2 (L2) cache. Texture information is stored in individual texels, which are used during graphics processing to define color data displayed at pixel coordinates. Texture data flows from system memory 104 to texture data management unit 114 , and then to texture cache system 116 , and then to texture filter 118 . It should be noted that for some embodiments, the texture data management unit 114 may be integrated in the texture cache system 116 .
现参看图2,其说明计算机图形系统内的纹理数据管理单元的某些基本元件。应注意出于简要的目的省略了对于描述纹理数据管理单元非必要的某些元件。计算机图形系统210包括用以接收纹理数据106的纹理数据管理单元212,数据在转发至纹理快取存储器系统116之前经压缩并重组。对于某些实施例,纹理数据管理单元212包括纹理数据格式器218、参数计算逻辑模块220以及地址计算逻辑模块214。Referring now to FIG. 2, some basic elements of a texture data management unit within a computer graphics system are illustrated. It should be noted that certain elements not necessary for describing the texture data management unit have been omitted for the sake of brevity. The computer graphics system 210 includes a texture data management unit 212 for receiving texture data 106 that is compressed and reassembled before being forwarded to the texture cache system 116 . For some embodiments, texture data management unit 212 includes texture data formatter 218 , parameter computation logic 220 , and address computation logic 214 .
简要参看图3,其为一实施例的L2快取存储器组织格式的方块图。如以上所述,纹理快取存储器系统116可包括多个快取存储器,包括(例如)L1快取存储器以及L2快取存储器。L2快取存储器310可包括多个L2页315,每一页315可分为多个L2数据线320,每一L2数据线320进一步分为偶数区块340以及奇数区块330。偶数区块340用于处理来自偶数管线或快取线的纹理数据,而奇数区块330用于处理来自奇数管线或快取线的纹理数据。在奇数区块330、偶数区块340中的每一者内,L2再分割为存储库(bank)350。尽管所揭示为每一区块包括两个存储库,但本领域技术人员应了解快取存储器可包括更多或更少的存储库。应注意尽管所示的L2数据线320包括2个区块、4个存储库以及8个页,但本领域技术人员应了解与给定实例具有不同架构的区块、存储库、页以及通道的快取存储器仍在本揭露内容的范畴内。此外,L2快取存储器310可包括多个L2数据线320,包括(例如)64个、128个、256个或512个。此外,每一L2数据线320可具有变化的宽度,包括(例如)128个、256个、512个、1024个或2048个位的宽度。Referring briefly to FIG. 3 , it is a block diagram of an L2 cache memory organization format according to an embodiment. As noted above, the texture cache system 116 may include multiple caches, including, for example, an L1 cache and an L2 cache. The
现参看图4,其为一实施例的32BPP(位/像素)的纹理像砖(以下简称像砖)。图4中的每一页360进一步被分为多个像砖。以实例说明的,图4中展示的每一像砖420为16kB,每一像砖420进一步再被分为多个通道。在所展示的实例中,像砖420包括8×8的通道排列,共64个通道,编号为Ch 0至Ch 63。最后,每一通道430进一步再被分为各个纹理元素。在所展示的实例中,每一通道430包括总共64个纹理元素的8×8的纹理元素排列。对于本文所揭露的实施例而言,纹理图数据内的纹理片储存在像砖420内。Referring now to FIG. 4 , it is a 32BPP (bits per pixel) texture image tile (hereinafter referred to as image tile) of an embodiment. Each
再参看图2,纹理数据格式器218接收纹理数据106且以有利于对数据将来撷取更有效的方法来组织纹理。纹理数据格式器218排列纹理数据内的纹理片,以使处于相同mip等级的纹理片分组在一起。纹理片根据渐增的mip等级(亦即,渐减的分辨率等级)加以排列。以此方法,纹理片根据“以纹理片为主”的格式加以排列。此外,以此方式将纹理数据的纹理片“挤压”或压缩在像砖内,以使得小于像砖大小的各个纹理片不占据各个像砖且留下未使用的存储器空间。因此,若一给定mip等级的所有纹理片可容纳至单一像砖,则仅将一像砖用来储存被压缩的该mip等级的所有纹理片。Referring again to FIG. 2, the texture data formatter 218 receives the texture data 106 and organizes the texture in a manner that facilitates more efficient retrieval of the data in the future. The texture data formatter 218 arranges the texture tiles within the texture data such that texture tiles at the same mip level are grouped together. The texture tiles are arranged according to increasing mip levels (ie, decreasing resolution levels). In this way, texture tiles are arranged according to a "texture tile-dominated" format. Furthermore, texture slices of texture data are "squeezed" or compressed within a tile in this way, so that individual texture slices that are smaller than the tile size do not occupy individual tiles and leave unused memory space. Thus, if all texture tiles of a given mip level fit into a single tile, only one tile is used to store all texture tiles of that mip level compressed.
若用以纹理片为主的格式重组纹理数据且将其压缩在一起,便可通过参数计算逻辑模块220确定与每一mip等级内的每一纹理片相关的参数。此等参数稍后用于确定经重组排列的纹理数据内的每个纹理片的地址,以使得信息在将来可自纹理快取存储器撷取。参数计算逻辑模块220对所有mip等级计算以下参数的每一个:所有纹理片大小、纹理宽度、纹理高度、纹理片索引数(index,N)、第一个纹理片(亦即,纹理片0)的x以及y偏移以及x跨步值(stride value)。所有纹理片大小的值为储存具有相同细节等级的所有纹理片所需的像砖的数目。在某一给定mip等级的所有纹理片可被“挤压”或压缩至单一像砖的情况下,将所有纹理片大小值设定为零以便指示此种组态。一旦所有参数的值计算完毕后,便将值传发至地址计算逻辑模块214。地址计算逻辑模块214接收这些值并计算包括纹理数据的所有纹理片的地址,以使得此数据在将来可自纹理快取存储器系统116提取。If the texture data is reorganized in a tile-based format and compressed together, parameters associated with each tile within each mip level can be determined by the parameter calculation logic module 220 . These parameters are later used to determine the address of each texture tile within the reordered texture data so that the information can be fetched from the texture cache in the future. The parameter calculation logic module 220 calculates each of the following parameters for all mip levels: all texel sizes, texel width, texel height, texel index number (index, N), first texel (i.e., texel 0) The x and y offsets and the x stride value. The value for the size of all texture tiles is the number of tiles required to store all texture tiles with the same level of detail. In the event that all texture tiles at a given mip level can be "squeezed" or compressed into a single tile, all texture tile size values are set to zero to indicate such a configuration. Once the values of all parameters are calculated, the values are sent to the address calculation logic module 214 . Address calculation logic module 214 receives these values and calculates the addresses of all texture tiles that include texture data so that this data can be fetched from texture cache memory system 116 in the future.
地址计算逻辑模块214计算以下参数:剩余纹理片的x以及y偏移、每一mip等级的每一纹理片的(x,y)坐标以及储存纹理图数据内的所有纹理片所需的像砖的总数目。一旦已重排所有纹理数据且已确定新地址信息,便准备储存纹理数据。与每一mip等级相关的新(x,y)坐标以及像砖的总数目会被传发至纹理快取存储器系统116。纹理数据管理单元114耦接至纹理快取存储器系统116。应了解储存在纹理快取存储器中的纹理数据现需用以纹理片为主的格式压缩并组织,以便减少存取时间以及最终地减少存储器延迟。The address calculation logic module 214 calculates the following parameters: the x and y offsets of the remaining texture tiles, the (x, y) coordinates of each texture tile at each mip level, and the image tiles required to store all the texture tiles in the texture map data total number of . Once all texture data has been rearranged and new address information has been determined, the texture data is ready to be stored. The new (x, y) coordinates associated with each mip level and the total number of tiles are sent to the texture cache system 116 . The texture data management unit 114 is coupled to the texture cache system 116 . It should be appreciated that texture data stored in texture cache memory now needs to be compressed and organized in a texture tile-based format in order to reduce access time and ultimately memory latency.
此外,由于纹理数据在存储器中的有效储存,撷取数据所需的计算资源量得以减少。亦应了解因为纹理片与适当的存储器地址对准,所以撷取数据所需的地址计算逻辑模块得以简化。最终,本发明揭露一种替代体积纹理贴图格式,其可使用由本领域技术人员已知的用于体积纹理贴图的相同参数加以实施。此替代纹理贴图格式的格式是基于以纹理片为主的格式的。In addition, due to the efficient storage of texture data in memory, the amount of computing resources required to retrieve the data is reduced. It should also be appreciated that because the texture tiles are aligned with the appropriate memory addresses, the address calculation logic required to fetch the data is simplified. Finally, the present invention discloses an alternative volume texture mapping format that can be implemented using the same parameters known by those skilled in the art for volume texture mapping. The format of this alternative texture map format is based on the texture sheet-based format.
图5描绘用于执行纹理像砖数据的以纹理片为主的压缩方法的实施例的流程图。在以下步骤中,可确定各种参数,所述参数随后用于计算根据某些实施例用以纹理片为主的拼贴(tiling)格式储存的每一纹理片的地址。以此方法可有效地储存纹理片,以便提供较有效率的数据存取。某些实施例中最大体积纹理大小可设定为尺寸2k×2k×2k。对于某些实施例,可通过将mip等级的最大数目设定为一预定数目(诸如12)来进一步简化地址计算。对于以下参数是针对每一mip等级来计算参数。出于本文所使用的命名法的目的,索引数N是用来指示纹理片的数目。此外,索引数d是用来指示mip等级。作为非限制性实例,Slice[0][d]是指处于mip等级d的纹理片[0]。5 depicts a flowchart of an embodiment of a method for performing a texture-slice-based compression method for texture-like tile data. In the following steps, various parameters may be determined, which are then used to calculate the address of each texture tile stored in a tile-based tiling format according to certain embodiments. In this way, texture tiles can be efficiently stored to provide more efficient data access. In some embodiments the maximum volumetric texture size may be set to a size of 2k x 2k x 2k. For some embodiments, address computation can be further simplified by setting the maximum number of mip levels to a predetermined number, such as 12. For the following parameters the parameters are calculated for each mip level. For the purposes of the nomenclature used herein, the index number N is used to indicate the number of texture tiles. In addition, the index number d is used to indicate the mip level. As a non-limiting example, Slice[0][d] refers to texture slice[0] at mip level d.
像砖的宽度以及高度是以像素来量测,且按照BPP(bit perpixel,每像素的位)来量测分辨率。出于本文所使用的命名法的目的,术语BPP可与术语BPE(bit per element,每元素的位)互换地使用。每一BPP值将具有对应的像砖宽度以及像砖高度。作为非限制性实例,32的BPP值(位/像素)对应于六十四个像素的像砖宽度(TileWidth)以及六十四个像素的像砖高度(TileHeight)。以下表1说明对于各种BPP值的不同像砖宽度以及高度:The width and height of the tiles are measured in pixels, and the resolution is measured in terms of BPP (bit per pixel, bits per pixel). For the purposes of the nomenclature used herein, the term BPP is used interchangeably with the term BPE (bit per element). Each BPP value will have a corresponding tile width and tile height. As a non-limiting example, a BPP value (bits/pixel) of 32 corresponds to a tile width (TileWidth) of sixty-four pixels and a tile height (TileHeight) of sixty-four pixels. Table 1 below illustrates the different tile widths and heights for various BPP values:
表1 对于各种BPE值的TileWidth以及TileHeight值Table 1 TileWidth and TileHeight values for various BPE values
表1中的参数eTW对应于表示TileWidth所需的位数。举例而言,需要5位以储存TileWidth值32。同样,参数eTH对应于表示TileHeight所需的位数。如以下进一步论述,参数eTW以及eTH用于逐位运算(bit-wise operation)。应注意对于本文所揭露的实施例,BPE值将为特定的。基于此值,便可知道对应的像砖宽度以及高度。The parameter eTW in Table 1 corresponds to the number of bits required to represent the TileWidth. For example, 5 bits are required to store a TileWidth value of 32. Likewise, the parameter eTH corresponds to the number of bits required to represent TileHeight. As discussed further below, the parameters eTW and eTH are used for bit-wise operations. It should be noted that for the embodiments disclosed herein, the BPE value will be specific. Based on this value, the corresponding tile width and height can be known.
方法开始于步骤510,根据mip等级将纹理图内的纹理片分组。接着,在步骤520中,根据模式标志将多个纹理片排列在同一像砖中。在步骤530中,针对每一mip等级计算关于每一纹理片的参数:所有纹理片大小(以像砖数目表示)、纹理宽度、纹理高度以及纹理片索引数。纹理片大小的值为零表示所有纹理片的大小小于像砖的大小。在此情况下,像砖纹理数据的储存可进一步“挤压”或压缩至单一像砖中,使纹理片不单独地占据整个像砖,且也不留下未使用的存储器空间,所以此处理为较佳的。若某一mip等级的所有纹理片的总和大于一个像砖,则将彼等纹理片与像砖对准,且计算储存此等纹理片所需的像砖的数目。否则,若确定所有纹理片的总和小于一个像砖,则纹理宽度以及高度值与二的幂数(power)对准,且将所有纹理片大小的值设定为零,以指示可将多个纹理片储存或“挤压”于单一像砖中。以上参数会针对每一mip等级来计算,mip等级的数目将视体积纹理贴图的尺寸而定。作为非限制性实例,假设将体积纹理大小设定为2k×2k×2k的尺寸,则会针对d=0至11,共12个mip等级,计算以上所描述的参数。The method starts at
随后计算以下参数:slice[0](亦即,每一mip等级的第一个纹理片)的x偏移、slice[0]的y偏移以及x跨步值。应注意此等参数的值将视选择何种模式而定。在图5的实施例中,两种主要模式可用于执行纹理像砖数据的以纹理片为主的储存,如通过模式标志所指示。在第一模式(亦即,模式=0)中,每一mip等级d的第一个纹理片(亦即,slice[0])未与零对准。意即,每一mip等级的slice[0]未与储存纹理片的像砖的最左边界对准。在第二模式(亦即,模式=1)中,每一mip等级d的第一个纹理片(亦即,slice[0])与零对准。意即,每一mip等级的slice[0]与储存纹理片的像砖的最左边界对准。简要地参看图6A以及6B,其说明用于图5中的实施例的两种模式。在图6A中所展示,像砖片610内每一mip等级的第一个纹理片(亦即,slice[0])未与像砖610的最左边界对准。此情形对应于模式0。相反,图6B展示每一mip等级的第一个纹理片与像砖620的最左边界对准。此情形对应于模式1。应了解可视再现物件所需的纹理片以及mip等级的数目而使用更多或更少的纹理片。The following parameters are then calculated: the x offset of slice[0] (ie, the first texture slice of each mip level), the y offset of slice[0], and the x stride value. It should be noted that the values of these parameters will depend on which mode is selected. In the embodiment of FIG. 5, two main modes are available for performing texture-slice-based storage of texture-like tile data, as indicated by the mode flags. In the first mode (ie, mode=0), the first texture slice (ie, slice[0]) of each mip level d is not aligned to zero. That is, slice[0] of each mip level is not aligned with the leftmost boundary of the tile storing the texture slice. In the second mode (ie, mode=1), the first texture slice (ie, slice[0]) of each mip level d is aligned to zero. That is, slice[0] at each mip level is aligned with the leftmost edge of the tile storing the texture slice. Referring briefly to FIGS. 6A and 6B, two modes for the embodiment in FIG. 5 are illustrated. As shown in FIG. 6A , the first texture slice of each mip level (ie, slice[0]) within the
再参看图5,x跨步值是视何模式(模式0或模式1)当前正用于纹理像砖数据的以纹理片为主的储存而计算。若利用模式0,则基于以下关系式使用x偏移(通过XoffsetMipSlice[0][d]表示)以及像砖宽度、eTW来计算x跨步(通过以下XStrideMip[d]表示)的值:Referring again to FIG. 5, the x-step value is calculated depending on which mode (
XStrideMip[d]=(1<<eTW)-XOffsetMipSlice[0][d];模式0XStrideMip[d]=(1<<eTW)-XOffsetMipSlice[0][d];
运算子“<<”表示逐位左移运算。若利用模式1(亦即,其中每一mip等级的slice[0]与像砖的最左边界对准),则值XStrideMip[d]仅等于像砖宽度(TileWidth)的值(见于以上表1中)。The operator "<<" represents a bitwise left shift operation. If using mode 1 (that is, where slice[0] of each mip level is aligned with the leftmost border of the tile), the value XStrideMip[d] is only equal to the value of the tile width (TileWidth) (see Table 1 above middle).
参数XOffsetMipSlice[0][d]表示某一mip等级d的第一个纹理片(亦即slice[0])在X方向上的偏移。此外,值YOffsetMipSlice[0][d]表示某一mip等级d的slice[0]在Y方向上的偏移。在使用每一mip等级的slice[0](第一个纹理片)与像素砖的最左边界对准的模式1的情况下,x偏移的值被设定为零;否则,使用先前所计算的x跨步值来计算x偏移的值。此外,若x偏移的值不是二的幂数个纹理像素,则将值四舍五入至最接近二的幂数值。对于x偏移的值,随后基于以下关系式计算XOffsetMipSlice[0][d]:The parameter XOffsetMipSlice[0][d] indicates the offset in the X direction of the first texture slice (that is, slice[0]) of a certain mip level d. In addition, the value YOffsetMipSlice[0][d] represents the offset in the Y direction of slice[0] of a certain mip level d. In the case of
对于模式1,XOffsetMipSlice[0][d]=0For
对于模式0,XOffsetMipSlice[0][d]=For
XOffsetMipS lice[0][d]-1+(N[d-1]<<ew[d-1])&((1<<eXStrideMip[d]-1)-1)XOffsetMipSlice[0][d]-1+(N[d-1]<<ew[d-1])&((1<<eXStrideMip[d]-1)-1)
亦考虑对准模式是模式0或是模式1来计算值YOffsetMipSlice[d]。若利用模式1,则通过以下关系式来确定值YOffsetMipSlice[d]:The value YOffsetMipSlice[d] is also calculated considering whether the alignment mode is
对于模式1,YOffsetMipSlice[0][d]=For
YOffsetMipSlice[0][d-1]+(((N[d-1]<<ew[d-1])+(1<<eTW)-1)>>eTW)<<eh[d-1]YOffsetMipSlice[0][d-1]+(((N[d-1]<<ew[d-1])+(1<<eTW)-1)>>eTW)<<eh[d-1]
对于模式0,YOffsetMipSlice[0][d]=For
YOffsetMipSlice[0][d]=YOffsetMipSlice[0][d-1]+(n[d-1]<<(ew[d-1]+eh[d-1]-eXStrideMip[d-1]))YOffsetMipSlice[0][d]=YOffsetMipSlice[0][d-1]+(n[d-1]<<(ew[d-1]+eh[d-1]-eXStrideMip[d-1]))
在步骤540中,基于以上所计算的参数来计算纹理图内的每一纹理片的存储器地址。随后针对x与y方向计算某一mip等级的每一纹理片N的偏移。如以上所论述的,参数XOffsetMipSlice[N]指示某一mip等级的纹理片N在X方向上的偏移。此外,值YOffsetMipSlice[N]为某一mip等级的纹理片N在Y方向上的偏移。此等偏移用于计算每一纹理片的新(x,y)坐标。使每一mip等级的slice[0]在x与y方向上的偏移与存储器地址零或为二的幂数的地址对准。对于x方向上的偏移为零的实施例,(每一mip等级的)slice[0]将总是与像砖的左边界对准。此外,x跨步值将等于像砖宽度TileWidth。最终,应注意若多个纹理片的大小小于一个像砖,则将彼等纹理片“挤压”或压缩于单一像砖中,以使得各个纹理片各自不会占据整个像砖。用以纹理片为主的方式执行压缩,其中将具有相同mip等级值的纹理片分组在一起。最终,在步骤550中,将经重排的纹理片储存在纹理快取存储器中以用于将来的撷取。In
参看图6A,其说明用于计算处于不同mip等级的每一纹理片的地址的不同参数。每一mip等级的slice[0]的偏移可与零对准或与为二的幂数的地址值对准。具体言之,可指示两种不同模式以用于储存的目的。模式0可用于指示每一mip等级的slice[0]未与零对准(亦即,未与像砖的最左边界对准)。Referring to Figure 6A, which illustrates different parameters used to calculate the address of each texture tile at different mip levels. The offset of slice[0] for each mip level may be aligned with zero or with an address value that is a power of two. Specifically, two different modes can be indicated for storage purposes.
现参看图7,其描绘用于将体积纹理贴图用以纹理片为主的格式储存在纹理快取存储器内的实施例。如所展示的,用以纹理片为主的格式储存纹理片,其中处于相同mip等级的纹理片以连续的方式储存在一起。亦应了解将纹理片“挤压”或压缩在一起,以致小于一像砖的各个纹理片不会占据整个像砖,从而留下浪费的存储器空间。如图7中所描绘的,纹理片亦储存在纹理快取存储器内的连续页面(页面N至页面(N+2))中。如较早所论述的,在存储器中将处于相同mip等级的纹理片紧密地储存在一起通常为有益的,纹理片最好可储存在同一快取页面中且甚至储存在同一快取线内(若可能),如此可加快数据存取且最终导致存储器延迟的减少。Referring now to FIG. 7 , an embodiment for storing volumetric texture maps in a texture tile-based format within a texture cache is depicted. As shown, texture tiles are stored in a tile-major format, where texture tiles at the same mip level are stored together in a contiguous manner. It should also be appreciated that texture tiles are "squeezed" or compressed together so that individual texture tiles that are smaller than a tile do not take up an entire tile, leaving wasted memory space. As depicted in FIG. 7, texture tiles are also stored in consecutive pages within the texture cache (page N through page (N+2)). As discussed earlier, it is often beneficial to store texture tiles at the same mip level close together in memory, texture tiles may preferably be stored in the same cache page and even within the same cache line ( If possible), this speeds up data access and ultimately leads to a reduction in memory latency.
图8描绘用于执行像砖纹理数据的以纹理片为主的压缩方法的另一实施例的流程图。方法开始于步骤810,将纹理图数据内的纹理片根据以纹理片为主的格式重排。接着,在步骤820中,若具有相同细节等级的所有纹理片的大小总和小于一像砖大小,则将具有相同细节等级的纹理片储存在一像砖内。在步骤830中,计算关于每一纹理片的参数。随后在步骤840中根据步骤830中所计算的参数计算纹理图数据内的每一纹理片的新存储器地址。最终,在步骤850中,将经重排的纹理片连同新的存储器地址储存在纹理快取存储器中。Figure 8 depicts a flowchart of another embodiment of a method for performing texture tile-based compression of brick-like texture data. The method starts at
如本领域技术人员所能了解的,流程图中的任何处理描述或步骤应理解为表示包括实施特定逻辑功能的一或多个可执行指令的逻辑、程序码的片段或部分,且替代实施例包括在本发明的较佳实施例的范畴内,其中可视所包括的功能性而以不同于所展示或所论述的次序执行功能(包括实质上同时或逆序执行)。As those skilled in the art can understand, any processing description or steps in the flowchart should be understood as representing logic, program code segments or parts including one or more executable instructions implementing specific logical functions, and alternative embodiments It is within the scope of preferred embodiments of the present invention wherein, depending on the functionality involved, functions may be performed in an order different from that shown or discussed (including substantially concurrent or reverse order execution).
此外,应强调以上所描述的实施例仅为可能实施例的实例。在不背离本发明的原则的情况下可对以上所描述的实施例进行许多变化以及修改。所有此等修改以及变化在本文中意欲包括在本发明的范畴内且通过权利要求书保护。Furthermore, it should be emphasized that the embodiments described above are only examples of possible embodiments. Many changes and modifications may be made to the above-described embodiments without departing from the principles of the invention. All such modifications and variations are intended to be included herein within the scope of this invention and protected by the following claims.
举例而言,基于本发明所提供的描述,本领域技术人员应了解实施例包括图形处理单元,图形处理单元包括纹理管理单元,纹理管理单元用以根据以纹理片为主的格式来组织纹理图数据,其中纹理图数据跨越至少一个mip等级。此外,图形处理系统包括纹理快取存储器,其中纹理快取存储器耦接至纹理管理单元,并用以接收来自纹理管理单元的经重组的纹理图数据。For example, based on the description provided by the present invention, those skilled in the art should understand that the embodiment includes a graphics processing unit, and the graphics processing unit includes a texture management unit, and the texture management unit is used to organize the texture map according to the texture sheet-based format data, where the texture map data spans at least one mip level. In addition, the graphics processing system includes a texture cache memory, wherein the texture cache memory is coupled to the texture management unit, and used for receiving reorganized texture map data from the texture management unit.
在某些实施例中,图形处理单元更包括纹理数据格式器,其根据以纹理片为主的格式排列纹理图数据内的纹理片;参数计算逻辑模块,其用以针对纹理图数据内的每一纹理片计算参数;以及地址计算逻辑模块,其用以使用所计算的参数来确定纹理图数据内的每一纹理片的快取存储器地址。In some embodiments, the graphics processing unit further includes a texture data formatter, which arranges texture slices in the texture map data according to a texture slice-based format; a parameter calculation logic module, which is used for each a texture slice calculation parameter; and an address calculation logic module, which is used for determining the cache memory address of each texture slice in the texture map data by using the calculated parameter.
在其他实施例中,纹理数据格式器进一步可用以在纹理片小于一像砖的情况下将多个纹理片储存在同一像砖内。在其他实施例中,纹理数据格式器可根据模式0或模式1排列纹理图数据内的纹理片,其中模式0指示每一mip等级的第一个纹理片与储存纹理片的像砖的最左边界对准,且其中模式1指示每一mip等级的第一个纹理片不与储存纹理片的像砖的最左边界对准。In other embodiments, the texture data formatter can further be used to store multiple texture tiles in the same tile if the texture tile is smaller than a tile. In other embodiments, the texture data formatter may arrange the texture tiles within the texture map data according to
在其他实施例中,参数包括以像砖数目来表示的纹理片大小、纹理宽度、纹理高度以及每一纹理片的纹理片索引数。对于某些实施例,参数更包括纹理片0的x偏移,其指示每一mip等级的第一个纹理片在x方向上的地址偏移;纹理片0的y偏移,其指示每一mip等级的第一个纹理片在y方向上的偏移;以及x跨步值,其指示每一mip等级的纹理片的每一集合的总宽度。对于某些实施例而言,是针对每个mip等级计算参数。对于某些实施例,若模式为1,则将第一个纹理片的x偏移设定为0。对于某些实施例,若模式为0,则将第一个纹理片的x偏移四舍五入为二的幂数。对于某些实施例,纹理图数据内的每一纹理片的快取存储器地址包括新值x,其指示每一纹理片的x坐标;新值y,其指示每一纹理片的y坐标;以及像砖索引数,其指示储存纹理图数据内的所有纹理片所需像砖的总数目。In other embodiments, the parameters include texel size in terms of number of tiles, texel width, texel height, and texel index per texel. For some embodiments, the parameters further include the x offset of
根据本发明的其他实施例,提供用于在图形处理器中储存纹理图数据的方法,且方法可通过以下步骤大致加以概括:根据mip等级将纹理图数据的纹理片分组在一起;根据模式标志将多个纹理片排列在同一像砖中;计算关于每一mip等级的每一纹理片的参数;根据所计算的参数计算纹理图数据内的每一纹理片的存储器地址;以及将经重排的纹理片储存在纹理快取存储器中。According to other embodiments of the present invention, a method for storing texture map data in a graphics processor is provided, and the method can be roughly summarized by the following steps: group texture tiles of texture map data together according to mip level; arranging a plurality of texture tiles in the same tile; calculating parameters about each texture tile of each mip level; calculating a memory address of each texture tile in the texture map data according to the calculated parameters; and rearranging The texture slices are stored in the texture cache memory.
在某些实施例中,排列纹理片更包括在模式标志设定为1的情况下,沿储存纹理片的像砖的最左边界对准每一mip等级的第一纹理片。对于某些实施例中,排列纹理片的方式更包括在模式标志设定为0的情况下,沿下一较低mip等级中的最后纹理片的最右边界对准每一mip等级的第一个纹理片。在某实施例中,计算参数包括计算纹理宽度;计算纹理高度;计算每一像砖的纹理片大小;计算每一纹理片的纹理片索引数;计算纹理片0的x偏移,其指示每一mip等级的第一个纹理片在x方向上的地址偏移;计算纹理片0的y偏移,其指示每一mip等级的第一个纹理片在y方向上的地址偏移;以及计算x跨步值,其指示每一mip等级的纹理片的每一集合的总宽度。对于某些实施例,计算纹理图数据内的每一纹理片的存储器地址包括计算新值x,其指示每一纹理片的x坐标;计算新值y,其指示每一纹理片的y坐标;以及计算像砖指数,其指示储存纹理图数据内的所有纹理片所需的像砖的总数目。In some embodiments, arranging the texture tiles further includes aligning the first texture tile of each mip level along the leftmost border of the tile storing the texture tiles when the mode flag is set to 1. For some embodiments, the arrangement of texture tiles further includes aligning the first mip level of each mip level along the rightmost border of the last texture tile in the next lower mip level when the mode flag is set to 0. textured slices. In one embodiment, calculating parameters includes calculating texture width; calculating texture height; calculating the texture slice size of each tile; calculating the texture slice index number of each texture slice; the address offset in the x direction of the first texture tile of a mip level; calculate the y offset of
根据本发明的其他实施例,提供用于在图形处理器中储存纹理图数据的方法,且方法可通过以下步骤大致加以概括:用以纹理片为主的格式重排纹理图数据的纹理片,其中具有相同细节等级的纹理片得以分组在一起;若具有相同细节等级的所有纹理片的总和小于一像砖的大小,则将具有相同细节等级的纹理片储存在一像砖内;针对每一细节等级计算关于每一纹理片的参数;根据所计算的参数计算纹理图数据内的每一纹理片的新存储器地址;以及将经重排的纹理片以及新存储器地址储存在纹理快取存储器中。According to other embodiments of the present invention, a method for storing texture map data in a graphics processor is provided, and the method can be roughly summarized by the following steps: rearranging the texture slices of the texture map data in a texture slice-based format, The texture slices with the same level of detail can be grouped together; if the sum of all texture slices with the same level of detail is less than the size of a tile, then the texture slices with the same level of detail are stored in a tile; for each calculating a parameter for each texture tile at the level of detail; calculating a new memory address for each texture tile within the texture map data according to the calculated parameter; and storing the rearranged texture tile and the new memory address in a texture cache .
对于某些实施例,计算关于每一纹理片的参数包括计算储存具有相同细节等级的所有纹理片所需像砖的数目;计算纹理的尺寸;计算每一纹理片的纹理片索引数;计算纹理片0的x偏移,其指示每一细节等级的第一个纹理片在x方向上的地址偏移;计算纹理片0的y偏移,其指示每一细节等级的第一个纹理片在y方向上的地址偏移;以及计算x跨步值,其指示每一细节等级的纹理片的每一集合的总宽度。对于某些实施例,将具有相同细节等级的纹理片储存在一像砖内更包括沿像砖的最右边界对准每一细节等级的第一个纹理片。对于某些实施例,将具有相同细节等级的纹理片储存在一像砖内更包括:对准每一细节等级的第一个纹理片紧跟在下一较低细节等级的最后纹理片之后。对于某些实施例,计算新存储器地址包括计算每一mip等级的每一经重排纹理片的(x,y)坐标以及计算储存纹理图数据内的所有纹理片所需的像砖的总数目。For some embodiments, computing the parameters for each texture tile includes computing the number of tiles required to store all texture tiles with the same level of detail; computing the size of the texture; computing the texture tile index number for each texture tile; computing the texture The x offset of
附图中符号的简单说明如下:A brief description of the symbols in the drawings is as follows:
100:计算机系统100: Computer Systems
102:CPU102: CPU
104:系统存储器104: System memory
106:纹理数据106: Texture data
108:系统接口108: System interface
110:图形处理系统110: Graphics processing system
112:前端处理器112: Front-end processor
114:纹理数据管理单元114: Texture data management unit
116:纹理快取存储器系统116: Texture cache system
118:纹理过滤器118: Texture Filter
120:帧缓冲器120: frame buffer
130:显示装置130: display device
210:计算机图形系统210: Computer Graphics Systems
212:纹理数据管理单元212: texture data management unit
Claims (12)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US81505306P | 2006-06-20 | 2006-06-20 | |
US60/815,053 | 2006-06-20 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101122997A CN101122997A (en) | 2008-02-13 |
CN100578542C true CN100578542C (en) | 2010-01-06 |
Family
ID=39022707
Family Applications (3)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNA2007101120142A Pending CN101145239A (en) | 2006-06-20 | 2007-06-19 | Graphics processing unit and method for processing border color information |
CN2007101233278A Active CN101114376B (en) | 2006-06-20 | 2007-06-20 | Method for reducing storage bank collision and computer system for processing graphics |
CN200710123324A Active CN100578542C (en) | 2006-06-20 | 2007-06-20 | Graphics processing system and method for storing texture map data in the same |
Family Applications Before (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNA2007101120142A Pending CN101145239A (en) | 2006-06-20 | 2007-06-19 | Graphics processing unit and method for processing border color information |
CN2007101233278A Active CN101114376B (en) | 2006-06-20 | 2007-06-20 | Method for reducing storage bank collision and computer system for processing graphics |
Country Status (2)
Country | Link |
---|---|
CN (3) | CN101145239A (en) |
TW (3) | TWI395152B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8368701B2 (en) * | 2008-11-06 | 2013-02-05 | Via Technologies, Inc. | Metaprocessor for GPU control and synchronization in a multiprocessor environment |
TWI474280B (en) * | 2010-04-21 | 2015-02-21 | Via Tech Inc | System and method for improving throughput of a graphics processing unit |
US9230517B2 (en) | 2012-05-31 | 2016-01-05 | Microsoft Technology Licensing, Llc | Virtual surface gutters |
DE102015115605A1 (en) | 2014-09-16 | 2016-03-17 | Jeffrey A. Bolz | Techniques for passing on dependencies in an API |
CN106611401B (en) * | 2015-10-22 | 2020-12-25 | 阿里巴巴集团控股有限公司 | Method and device for storing image in texture memory |
CN112381715B (en) * | 2020-11-16 | 2024-04-09 | 航天科工(北京)空间信息应用股份有限公司 | Method and device for parallel generation of map tiles by mass remote sensing images |
CN114036612B (en) * | 2021-11-05 | 2025-02-11 | 土巴兔集团股份有限公司 | Room paving quantity calculation method, device and storage medium based on layout placement |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1564203A (en) * | 2004-04-12 | 2005-01-12 | 浙江大学 | Fast drawing forest method of graded hierarchical assembling depth paste-up atlas |
CN1625757A (en) * | 2002-02-01 | 2005-06-08 | 皇家飞利浦电子股份有限公司 | Stepless 3d texture mapping in computer graphics |
CN1624723A (en) * | 2003-02-21 | 2005-06-08 | 威盛电子股份有限公司 | Single-layer downscaling filtering theory for heterogeneous textures |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5765182A (en) * | 1995-04-13 | 1998-06-09 | Lsi Logic Corporation | Interleaving memory on separate boards |
US5828382A (en) * | 1996-08-02 | 1998-10-27 | Cirrus Logic, Inc. | Apparatus for dynamic XY tiled texture caching |
WO2000010372A2 (en) * | 1998-08-20 | 2000-03-02 | Apple Computer, Inc. | System, apparatus and method for spatially sorting image data in a three-dimensional graphics pipeline |
US6300953B1 (en) * | 1998-10-15 | 2001-10-09 | Nvidia | Apparatus and method for grouping texture cache requests |
US6266733B1 (en) * | 1998-11-12 | 2001-07-24 | Terarecon, Inc | Two-level mini-block storage system for volume data sets |
US7050063B1 (en) * | 1999-02-11 | 2006-05-23 | Intel Corporation | 3-D rendering texture caching scheme |
US6650333B1 (en) * | 1999-06-09 | 2003-11-18 | 3Dlabs Inc., Ltd. | Multi-pool texture memory management |
US6825848B1 (en) * | 1999-09-17 | 2004-11-30 | S3 Graphics Co., Ltd. | Synchronized two-level graphics processing cache |
US7053904B1 (en) * | 2003-12-15 | 2006-05-30 | Nvidia Corporation | Position conflict detection and avoidance in a programmable graphics processor |
-
2007
- 2007-06-19 CN CNA2007101120142A patent/CN101145239A/en active Pending
- 2007-06-20 TW TW096122072A patent/TWI395152B/en active
- 2007-06-20 CN CN2007101233278A patent/CN101114376B/en active Active
- 2007-06-20 TW TW096122024A patent/TWI367455B/en active
- 2007-06-20 CN CN200710123324A patent/CN100578542C/en active Active
- 2007-06-20 TW TW096122026A patent/TWI341976B/en active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1625757A (en) * | 2002-02-01 | 2005-06-08 | 皇家飞利浦电子股份有限公司 | Stepless 3d texture mapping in computer graphics |
CN1624723A (en) * | 2003-02-21 | 2005-06-08 | 威盛电子股份有限公司 | Single-layer downscaling filtering theory for heterogeneous textures |
CN1564203A (en) * | 2004-04-12 | 2005-01-12 | 浙江大学 | Fast drawing forest method of graded hierarchical assembling depth paste-up atlas |
Also Published As
Publication number | Publication date |
---|---|
TWI367455B (en) | 2012-07-01 |
TWI395152B (en) | 2013-05-01 |
TWI341976B (en) | 2011-05-11 |
TW200809691A (en) | 2008-02-16 |
TW200821988A (en) | 2008-05-16 |
CN101114376B (en) | 2010-06-23 |
CN101145239A (en) | 2008-03-19 |
CN101114376A (en) | 2008-01-30 |
TW200819987A (en) | 2008-05-01 |
CN101122997A (en) | 2008-02-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7965296B2 (en) | Systems and methods for storing texture map data | |
US7898551B2 (en) | Systems and methods for performing a bank swizzle operation to reduce bank collisions | |
CN100578542C (en) | Graphics processing system and method for storing texture map data in the same | |
US8970583B1 (en) | Image space stylization of level of detail artifacts in a real-time rendering engine | |
KR100510131B1 (en) | Pixel cache, 3D graphic accelerator using it, and method therefor | |
JP4938850B2 (en) | Graphic processing unit with extended vertex cache | |
CN100378761C (en) | Texture filter using parallel processing to improve multi-mode filter performance | |
US9633405B2 (en) | Tile based computer graphics | |
US20070070079A1 (en) | Programmable 3d graphics pipeline for multimedia applications | |
US8009172B2 (en) | Graphics processing unit with shared arithmetic logic unit | |
WO2000011602A9 (en) | Method and apparatus for generating texture | |
JP2012033173A (en) | Tiled prefetch and cached depth buffer | |
US6891546B1 (en) | Cache memory for texture mapping process in three-dimensional graphics and method for reducing penalty due to cache miss | |
GB2476140A (en) | Shadow rendering using stencil and depth buffers | |
US20100182314A1 (en) | Method, display adapter and computer program product for improved graphics performance by using a replaceable culling program | |
US8736627B2 (en) | Systems and methods for providing a shared buffer in a multiple FIFO environment | |
US10192348B2 (en) | Method and apparatus for processing texture | |
US7483035B2 (en) | Texture cache control using a data dependent slot selection scheme | |
KR20160068204A (en) | Data processing method for mesh geometry and computer readable storage medium of recording the same | |
US20080211823A1 (en) | Three-dimensional graphic accelerator and method of reading texture data | |
JP4624995B2 (en) | Texturing 3D computer graphic images | |
US11887211B2 (en) | Texture mapping | |
US20080165208A1 (en) | 3-Dimensional graphic processing apparatus and operating method thereof | |
EP4398193A1 (en) | Applying texture processing to a block of fragments in a graphics processing unit | |
US20240212257A1 (en) | Workload packing in graphics texture pipeline |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |