WO2022007207A1 - Tiled graphic data read/write method and apparatus, and device, and storage medium - Google Patents

Tiled graphic data read/write method and apparatus, and device, and storage medium Download PDF

Info

Publication number
WO2022007207A1
WO2022007207A1 PCT/CN2020/118636 CN2020118636W WO2022007207A1 WO 2022007207 A1 WO2022007207 A1 WO 2022007207A1 CN 2020118636 W CN2020118636 W CN 2020118636W WO 2022007207 A1 WO2022007207 A1 WO 2022007207A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
attribute
primitive
register
data group
Prior art date
Application number
PCT/CN2020/118636
Other languages
French (fr)
Chinese (zh)
Inventor
焦永
Original Assignee
长沙景嘉微电子股份有限公司
长沙景美集成电路设计有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Priority claimed from CN202010662730.3A external-priority patent/CN111882482B/en
Application filed by 长沙景嘉微电子股份有限公司, 长沙景美集成电路设计有限公司 filed Critical 长沙景嘉微电子股份有限公司
Publication of WO2022007207A1 publication Critical patent/WO2022007207A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Definitions

  • Embodiments of the present application provide a method, device, device, and storage medium for reading and writing data in graphics blocks, which are used to solve the problem of high data bandwidth occupancy between the GPU and the memory in the traditional solution.
  • the graphic metadata acquisition module is used to acquire each graphic metadata to be written in the graphic block data, where the graphic metadata includes attribute data of all attributes supported by the graphic element;
  • FIG. 1 is a flowchart of a method for writing graphics block data according to Embodiment 1 of the present application. As shown in FIG. 1 , the present application provides a method for writing graphics block data, including:
  • Step 203 generating a second data group corresponding to the primitives one-to-one according to the graphic element data, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data is stored continuously;
  • the order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group.
  • the next primitive data is obtained, and the above steps 201 to 205 are repeatedly executed until all the primitive data in a block of data are processed and written into the memory and addresses are written into the RAM.
  • This embodiment further optimizes the method for reading graphics block data on the basis of the above-mentioned embodiment.
  • Step 407 When it is determined that the current address data is different from the address initially allocated in the preset storage area, read the primitive data packet from the memory, and parse to obtain the packet header and the packet data.
  • the second data group generation module includes: a second register configuration unit and a second register configuration unit.
  • the second register configuration unit is configured to configure the second registers corresponding to the primitives one-to-one.
  • the second register configuration unit is configured to write data into the second register according to the primitive data, each preset length data in the second register is used as an element, and all elements of the second register form a second data group.

Abstract

A tiled graphic data read/write method and apparatus, and a device, and a storage medium. The data write method comprises: obtaining each piece of primitive data to be written into tiled graphic data, the primitive data comprising attribute data of all attributes supported by a primitive (101); generating a first data group, each element therein representing whether the primitive contains an attribute, the contained attribute being an effective attribute; generating a second data group, each element therein being effective attribute data corresponding to the effective attribute, each effective attribute data being continuously stored, the sequence of the effective attribute data arranged in the second data group being consistent with the sequence of the corresponding effective attributes arranged in the first data group; and generating a primitive data packet according to the first data group and the second data group, and writing the primitive data packet into a memory. The tiled graphic data read/write method and apparatus, and the device, and the storage medium can solve the problem in conventional solutions that the occupancy rate of the data bandwidth between a GPU and the memory is relatively high.

Description

图形分块数据读写方法、装置、设备及存储介质Graphic block data reading and writing method, device, device and storage medium 技术领域technical field
本申请涉及图形处理技术,尤其涉及一种图形分块数据读写方法、装置、设备及存储介质。The present application relates to graphics processing technologies, and in particular, to a method, device, device and storage medium for reading and writing graphics block data.
背景技术Background technique
图形处理器(Graphics Processing Unit,简称GPU)是一种专门用于对图像或图形进行处理的处理器,应用在电子终端的显示系统中,能够减轻中央处理器(central processing unit,简称CPU)在图像或图形处理方面的压力,提高显示系统的整体处理效率。Graphics Processing Unit (GPU) is a processor specially used to process images or graphics. It is applied in the display system of electronic terminals and can reduce the central processing unit (CPU) in the Image or graphics processing pressure, improving the overall processing efficiency of the display system.
图形分块渲染是目前应用较为广泛的一种GPU渲染架构,相比于传统的立即渲染架构,能够降低渲染过程中GPU对读写存储器的频次,进而提高渲染效率。在GPU执行图形分块渲染之前需要对一帧图形进行分块,并将分块数据写入存储器。在渲染的过程中,依次从存储器中读取各分块数据,分别进行渲染。Graphics block rendering is a widely used GPU rendering architecture. Compared with the traditional immediate rendering architecture, it can reduce the frequency of the GPU reading and writing memory during the rendering process, thereby improving rendering efficiency. Before the GPU performs graphics tiled rendering, a frame of graphics needs to be tiled, and the tiled data is written to the memory. During the rendering process, each block data is sequentially read from the memory and rendered separately.
每个分块数据中包含多个图元的数据,每个图元的数据包含该图元所支持的所有属性的属性数据,每个属性数据占用4个字节。但通常情况下,图元并非含有所有的属性,图元不含有的属性数据作为无效数据,与其他属性数据一起写入存储器及从存储器被读出,造成GPU和存储器之间的数据带宽占用率较高。Each block data contains data of multiple primitives, the data of each primitive includes attribute data of all attributes supported by the primitive, and each attribute data occupies 4 bytes. But usually, the primitive does not contain all attributes, the attribute data that the primitive does not contain is regarded as invalid data, and is written into the memory and read from the memory together with other attribute data, resulting in the data bandwidth usage between the GPU and the memory. higher.
发明内容SUMMARY OF THE INVENTION
本申请实施例中提供一种图形分块数据读写方法、装置、设备及存储介质,用于解决传统方案中GPU和存储器之间的数据带宽占用率较高的问题。Embodiments of the present application provide a method, device, device, and storage medium for reading and writing data in graphics blocks, which are used to solve the problem of high data bandwidth occupancy between the GPU and the memory in the traditional solution.
本申请第一方面实施例提供一种图形分块数据写入方法,包括:An embodiment of the first aspect of the present application provides a method for writing graphics block data, including:
获取待写入图形分块数据中的各图元数据,所述图元数据包括图元支持的所有属性的属性数据;Acquiring each graphic element data to be written in the graphic block data, the graphic element data includes attribute data of all attributes supported by the graphic element;
根据所述图元数据生成与图元一一对应的第一数据组,所述第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;A first data group corresponding to the primitives one-to-one is generated according to the primitive data, and each element in the first data group is used to indicate whether the primitive contains an attribute; when the primitive contains an attribute, the attribute is a valid attribute;
根据所述图元数据生成与图元一一对应的第二数据组,所述第二数据组中的每一个元素为所述第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;所述有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致;Generate a second data group corresponding to the primitives one-to-one according to the primitive data, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data Continuous storage; the order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group;
根据第一数据组和第二数据组中的数据生成图元数据包,并将图元数据包写入存储器;所述第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。Generate a primitive data packet according to the data in the first data group and the second data group, and write the primitive data packet into the memory; the data in the first data group is used as the header of the primitive data packet, and the second data group The data in as package data in the metadata package.
本申请实施例提供的技术方案,首先获取待写入图形分块数据中的各图元数据,图元数据包括图元支持的所有属性的属性数据;然后根据图元数据生成与图元一一对应的第一数据组,第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性;根据图元数据生成与图元一一对应的第二数据组,第二数据组中的每一个元素为第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致;之后,根据第一数据组和第二数据组中的数据生成图元数据包,并将图元数据包写入存储器;第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。采用上述方案生成的第二数据组只包括图元含有的属性对应的有效属性数据,而图元不含有的属性对应的属性数据则不在第二数据组内,相当于第二数据组的数据量少于原始的图元数据,因此减少了向存储器写入的数据量,进而降低了处理器与存储器之间的带宽占用率,进而提高处理器的处理效率。In the technical solution provided by the embodiments of the present application, each graphic element data to be written into the graphic block data is first obtained, and the graphic element data includes attribute data of all attributes supported by the graphic element; Corresponding first data group, each element in the first data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is a valid attribute; according to the graphic element data, the one-to-one correspondence with the graphic element is generated The second data group, each element in the second data group is the valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data is stored continuously; the order of the valid attribute data in the second data group corresponds to The valid attributes are arranged in the same order in the first data group; after that, a primitive data packet is generated according to the data in the first data group and the second data group, and the primitive data packet is written into the memory; The data is used as the header of the primitive data packet, and the data in the second data group is used as the packet data in the primitive data packet. The second data group generated by the above solution only includes valid attribute data corresponding to the attributes contained in the graphic element, while the attribute data corresponding to the attributes not contained in the graphic element is not in the second data group, which is equivalent to the data volume of the second data group It is less than the original primitive data, thus reducing the amount of data written to the memory, thereby reducing the bandwidth occupancy rate between the processor and the memory, thereby improving the processing efficiency of the processor.
本申请第二方面实施例提供一种图形分块数据读取方法,包括:An embodiment of the second aspect of the present application provides a method for reading graphic block data, including:
从存储器读出图元数据包,并解析得到包头和包数据;Read the primitive data packet from the memory, and parse to obtain the packet header and packet data;
根据所述包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;A third data group is generated according to the packet header, and each element in the third data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is a valid attribute;
根据所述包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据;Generate a fourth data group according to the package data, and each element in the fourth data group is an effective attribute data;
按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取一个元素的数据作为与有效属性对应的有效属性数据。According to the arrangement order of the valid attributes in the third data group, the data of one element is sequentially read from the fourth data group as the valid attribute data corresponding to the valid attributes.
本申请实施例提供的技术方案,采用从存储器读出图元数据包,并解析得到包头和包数据;根据包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,该属性为有效属性;根据包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据;按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取一个元素的数据作为与有效属性对应的有效属性数据;由于图元数据包中的第四数据组的数据量会少于传统方案中的图元数据,因此能够减少从存储器中读出的数据量,进而降低了对处理器与存储器之间带宽的占用率。In the technical solution provided by the embodiment of the present application, the primitive data packet is read from the memory, and the packet header and packet data are obtained by parsing; a third data group is generated according to the packet header, and each element in the third data group is used to indicate whether the primitive is Contains an attribute; when the graphic element contains an attribute, the attribute is a valid attribute; the fourth data group is generated according to the package data, and each element in the fourth data group is a valid attribute data; according to the valid attributes in the third data group , read the data of one element from the fourth data group in turn as the effective attribute data corresponding to the effective attribute; because the data volume of the fourth data group in the primitive data package will be less than the primitive in the traditional scheme Therefore, the amount of data read out from the memory can be reduced, thereby reducing the occupancy rate of the bandwidth between the processor and the memory.
本申请第三方面实施例提供一种图形分块数据写入装置,包括:An embodiment of a third aspect of the present application provides a graphics block data writing device, including:
图元数据获取模块,用于获取待写入图形分块数据中的各图元数据,所述图元数据包括图元支持的所有属性的属性数据;The graphic metadata acquisition module is used to acquire each graphic metadata to be written in the graphic block data, where the graphic metadata includes attribute data of all attributes supported by the graphic element;
第一数据组生成模块,用于根据所述图元数据生成与图元一一对应的第一数据组,所述第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;The first data group generation module is used to generate a first data group corresponding to the primitives one-to-one according to the primitive data, and each element in the first data group is used to indicate whether the primitive contains an attribute; when When a primitive contains an attribute, the attribute is a valid attribute;
第二数据组生成模块,用于根据所述图元数据生成与图元一一对应的第二数据组,所述第二数据组中的每一个元素为所述第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;所述有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致;A second data group generating module, configured to generate a second data group corresponding to the primitives one-to-one according to the primitive data, and each element in the second data group corresponds to a valid attribute in the first data group The valid attribute data of , each valid attribute data is stored continuously; the order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group;
图元数据包生成模块,用于根据第一数据组和第二数据组中的数据生成图元数据包;所述第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据;The graphic element data packet generating module is used to generate the graphic element data packet according to the data in the first data group and the second data group; the data in the first data group is used as the header of the graphic element data packet, and the data in the second data group The data is used as the package data in the primitive data package;
图元数据包写入模块,用于将图元数据包写入存储器。The primitive data packet writing module is used to write the primitive data packet into the memory.
本申请第四方面实施例提供一种图像分块数据读取装置,包括:The embodiment of the fourth aspect of the present application provides an image block data reading device, including:
图元数据包读出模块,用于从存储器读出图元数据包,并解析得到包头和包数据;The primitive data packet reading module is used to read out the primitive data packet from the memory, and parse to obtain the packet header and packet data;
第三数据组生成模块,用于根据所述包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;The third data group generating module is configured to generate a third data group according to the packet header, and each element in the third data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is valid attributes;
第四数据组生成模块,用于根据所述包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据;The fourth data group generation module is used to generate a fourth data group according to the packet data, and each element in the fourth data group is an effective attribute data;
有效属性数据读取模块,用于按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取预设长度的数据作为与有效属性对应的有效属性数据。The valid attribute data reading module is configured to sequentially read data of a preset length from the fourth data group as valid attribute data corresponding to the valid attributes according to the arrangement sequence of the valid attributes in the third data group.
本申请第五方面实施例提供一种图形分块数据读写系统,包括:如上所述的图形分块数据写入装置和/或如上所述的图形分块数据读取装置。Embodiments of the fifth aspect of the present application provide a system for reading and writing data in graphic blocks, including: the above device for writing data in graphic blocks and/or the above device for reading data in graphic blocks.
本申请第六方面实施例提供一种计算机可读存储介质,其上存储有计算机程序;所述计算机程序被处理器执行以实现如上所述的写入方法和/或如上所述的读取方法。Embodiments of the sixth aspect of the present application provide a computer-readable storage medium on which a computer program is stored; the computer program is executed by a processor to implement the above-mentioned writing method and/or the above-mentioned reading method .
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:
图1为本申请实施例一提供的图形分块数据写入方法的流程图;1 is a flowchart of a method for writing graphics block data provided in Embodiment 1 of the present application;
图2为本申请实施例一提供的图元数据的示意图;FIG. 2 is a schematic diagram of graphic metadata provided in Embodiment 1 of the present application;
图3为本申请实施例一提供的第一数据组的示意图;3 is a schematic diagram of a first data set provided in Embodiment 1 of the present application;
图4为本申请实施例一提供的第二数据组与第一数据组之间的关系示意图;4 is a schematic diagram of the relationship between the second data group and the first data group provided in Embodiment 1 of the present application;
图5为本申请实施例二提供的第一寄存器的示意图;5 is a schematic diagram of a first register provided in Embodiment 2 of the present application;
图6为本申请实施例二提供的第二寄存器与第一寄存器之间的关系示意图;6 is a schematic diagram of the relationship between the second register and the first register provided in Embodiment 2 of the present application;
图7为本申请实施例三提供的图形分块数据写入方法的流程图;7 is a flowchart of a method for writing graphic block data provided in Embodiment 3 of the present application;
图8为本申请实施例四提供的图形分块数据读取方法的流程图;8 is a flowchart of a method for reading graphic block data provided in Embodiment 4 of the present application;
图9为本申请实施例六提供的图形分块数据读取方法的流程图;9 is a flowchart of a method for reading graphic block data provided in Embodiment 6 of the present application;
图10为本申请实施例七提供的图形分块数据读写方法的流程图;FIG. 10 is a flowchart of a method for reading and writing graphic block data provided in Embodiment 7 of the present application;
图11为本申请实施例八提供的图形分块数据写入装置的结构示意图;11 is a schematic structural diagram of a graphics block data writing device provided in Embodiment 8 of the present application;
图12为本申请实施例九提供的图形分块数据读取装置的结构示意图;12 is a schematic structural diagram of a graphic block data reading device provided in Embodiment 9 of the present application;
图13为本申请实施例十提供的图形分块数据读写系统的结构示意图。FIG. 13 is a schematic structural diagram of a graphic block data reading and writing system provided by Embodiment 10 of the present application.
具体实施方式detailed description
为了使本申请实施例中的技术方案及优点更加清楚明白,以下结合附图对本申请的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本申请的一部分实施例,而不是所有实施例的穷举。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。In order to make the technical solutions and advantages of the embodiments of the present application more clear, the exemplary embodiments of the present application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and Not all embodiments are exhaustive. It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict.
实施例一Example 1
本实施例提供一种图形分块数据写入方法,可以由处理器来执行,尤其是由图形处理器GPU来执行。本实施例提供的图形分块数据写入方法用于对图形分块数据进行写入,能够降低处理器与存储器之间的带宽占用率。This embodiment provides a method for writing graphics block data, which can be executed by a processor, especially a graphics processor GPU. The graphic block data writing method provided in this embodiment is used for writing graphic block data, which can reduce the bandwidth occupancy rate between the processor and the memory.
本实施例所提供的图形分块数据写入方法可适用于在对图形进行渲染之前,即:先对一帧图形进行分块操作,然后执行本实施例提供的方案,然后根据本实施例处理后的数据进行渲染。当然,本实施例所提供的方案也可以用于其他场景,不限定于渲染。The method for writing graphics data in blocks provided by this embodiment can be applied to before rendering graphics, that is: first perform a block operation on a frame of graphics, then execute the solution provided by this embodiment, and then process according to this embodiment After the data is rendered. Of course, the solution provided in this embodiment can also be used in other scenarios, and is not limited to rendering.
实际应用中,该图形分块数据写入方法可以通过计算机程序实现,例如, 应用软件等;或者,该方法也可以实现为存储有相关计算机程序的介质,例如,U盘、云盘等;再或者,该方法还可以通过集成或安装有相关计算机程序的实体装置实现,例如,芯片、可移动智能设备等。In practical applications, the method for writing data in blocks of graphics can be implemented by a computer program, such as application software, etc.; or, the method can also be implemented as a medium storing relevant computer programs, such as a U disk, a cloud disk, etc.; Alternatively, the method can also be implemented by a physical device integrated or installed with a relevant computer program, such as a chip, a mobile smart device, and the like.
图1为本申请实施例一提供的图形分块数据写入方法的流程图。如图1所示,本申请提供一种图形分块数据写入方法,包括:FIG. 1 is a flowchart of a method for writing graphics block data according to Embodiment 1 of the present application. As shown in FIG. 1 , the present application provides a method for writing graphics block data, including:
步骤101、获取待写入图形分块数据中的各图元数据,图元数据包括图元支持的所有属性的属性数据。Step 101: Acquire each graphic element data to be written in the graphic block data, where the graphic element data includes attribute data of all attributes supported by the graphic element.
在GPU执行图形分块渲染之前需要对每一帧图形进行分块,分块得到的数据即为上述待写入图形分块数据。Before the GPU performs graphics segmentation rendering, each frame of graphics needs to be segmented, and the data obtained by segmenting is the above-mentioned graphics segment data to be written.
每一个待写入图形分块数据中包含有至少一个图元对应的图元数据,图元可以为点、线、面、多边形等。每一个图元包含至少一个属性,属性可以为:边框颜色、填充颜色、填充纹理、线宽、线型等。Each graphic block data to be written contains at least one primitive corresponding to the primitive data, and the primitive may be a point, a line, a surface, a polygon, or the like. Each primitive contains at least one attribute, which can be: border color, fill color, fill texture, line width, line type, etc.
每一个图元可支持多个属性,但不一定包含所有的属性。例如:一个三角形图元支持的属性有:边框颜色、填充颜色、填充纹理、线宽等。实际情况中,一个三角形图元包含有边框颜色的属性,但不包含填充纹理的属性。本实施例中,将边框颜色的属性称为三角形图元的有效属性,将填充纹理的属性称为三角形图元的无效属性。Each primitive can support multiple attributes, but not necessarily all attributes. For example, the properties supported by a triangle primitive are: border color, fill color, fill texture, line width, etc. In practice, a triangle primitive contains properties for the border color, but not for the fill texture. In this embodiment, the attribute of the border color is called the valid attribute of the triangle primitive, and the attribute of the filling texture is called the invalid attribute of the triangle primitive.
上述图元数据包括图元支持的所有属性的属性数据。例如:一个三角形图元对应的图元数据包括:框颜色、填充颜色、填充纹理、线宽等所有支持的属性对应的属性数据。例如:对于有效属性,对应的有效属性数据为实际的数据;对于无效属性,对应的无效属性数据可以为零。The above-mentioned primitive data includes attribute data of all attributes supported by the primitive. For example, the primitive data corresponding to a triangle primitive includes attribute data corresponding to all supported attributes such as box color, fill color, fill texture, and line width. For example, for a valid attribute, the corresponding valid attribute data is actual data; for an invalid attribute, the corresponding invalid attribute data can be zero.
图2为本申请实施例一提供的图元数据的示意图。图2展示了一个图元数据,该图元支持10个属性,则图元数据包含10个属性的属性数据,如图2中的属性1至属性10。其中,该图元包含属性1、属性2、属性5、属性8和属性10,则属性1、属性2、属性5、属性8和属性10为有效属性,属性1和属性5对应的有效属性数据为:01 2C 00 6D(十六进制),属性2、属性8和属 性10对应的有效属性数据为:11 0E 00 F0(十六进制),。图元不包含属性3、属性4、属性6、属性7和属性9,则属性3、属性4、属性6、属性7和属性9为无效属性,对应的无效属性数据均为00 00 00 00(十六进制)。属性数据的长度为4字节。FIG. 2 is a schematic diagram of graphic metadata provided in Embodiment 1 of the present application. FIG. 2 shows a graphic element data, the graphic element supports 10 attributes, and the graphic element data includes attribute data of 10 attributes, such as attribute 1 to attribute 10 in FIG. 2 . Among them, the graphic element includes attribute 1, attribute 2, attribute 5, attribute 8 and attribute 10, then attribute 1, attribute 2, attribute 5, attribute 8 and attribute 10 are valid attributes, and the valid attribute data corresponding to attribute 1 and attribute 5 It is: 01 2C 00 6D (hexadecimal), and the valid attribute data corresponding to attribute 2, attribute 8 and attribute 10 is: 11 0E 00 F0 (hexadecimal). The primitive does not contain attribute 3, attribute 4, attribute 6, attribute 7 and attribute 9, then attribute 3, attribute 4, attribute 6, attribute 7 and attribute 9 are invalid attributes, and the corresponding invalid attribute data are all 00 00 00 00 ( hexadecimal). The length of attribute data is 4 bytes.
上述各属性数据的数值仅为举例,数值并不具有实际意义,也不限定于上述数据。The numerical values of the above-mentioned attribute data are only examples, and the numerical values have no practical significance and are not limited to the above-mentioned data.
步骤102、根据图元数据生成与图元一一对应的第一数据组,第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性。Step 102: Generate a first data group corresponding to the graphic element one-to-one according to the graphic element data, and each element in the first data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is valid. Attributes.
根据上述步骤101获取到的图元数据生成第一数据组,该第一数据组与图元一一对应。第一数据组包含多个元素,每一个元素用于表示图元是否含有一个属性。A first data group is generated according to the primitive data obtained in the above step 101, and the first data group is in one-to-one correspondence with the primitives. The first data group includes a plurality of elements, and each element is used to indicate whether the primitive contains an attribute.
图3为本申请实施例一提供的第一数据组的示意图。如图3所示,第一数据组包含有十个元素,从右向左依次为元素0,元素1,……,元素9。每一个元素用于表示图元是否含有一个属性。例如:当图元包含有一个属性时,该属性对应的元素值为“X”;当图元不包含一个属性时,该属性对应的元素值为“0”。如图3所示,元素0、元素1、元素4、元素7和元素9的值为“X”,表示图元包含这些元素对应的属性,即为有效属性;元素2、元素3、元素5、元素6和元素8的值为“0”,表示图元不包含这些元素对应的属性,即为无效属性。FIG. 3 is a schematic diagram of a first data set provided in Embodiment 1 of the present application. As shown in FIG. 3 , the first data group contains ten elements, which are element 0, element 1, . . . , element 9 in order from right to left. Each element is used to indicate whether the primitive contains an attribute. For example: when the graphic element contains an attribute, the element value corresponding to the attribute is "X"; when the graphic element does not contain an attribute, the element value corresponding to the attribute is "0". As shown in Figure 3, the value of element 0, element 1, element 4, element 7 and element 9 is "X", indicating that the graphic element contains the attributes corresponding to these elements, which is a valid attribute; element 2, element 3, element 5 , element 6 and element 8 have the value "0", indicating that the graphic element does not contain the attributes corresponding to these elements, that is, it is an invalid attribute.
生成第一数据组的方式可以根据上述图元数据进行确定,例如:当第一数据组中的某个属性数据为零时,将第一数据组中的对应元素写为零;当第一数据组中的某个属性数据不为零时,将第一数据组中的对应元素写为“X”。The way of generating the first data group can be determined according to the above-mentioned graphic metadata, for example: when a certain attribute data in the first data group is zero, write the corresponding element in the first data group as zero; When a certain attribute data in the group is not zero, write the corresponding element in the first data group as "X".
步骤103、根据图元数据生成与图元一一对应的第二数据组,第二数据组中的每一个元素为第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致。 Step 103, generating a second data group corresponding to the primitives one-to-one according to the graphic element data, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data is stored continuously; The order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group.
根据上述图元数据生成第二数据组,第二数据组与图元一一对应。第二数据组包含有多个元素,每一个元素为有效属性数据。A second data group is generated according to the above-mentioned primitive data, and the second data group is in one-to-one correspondence with the primitives. The second data group contains a plurality of elements, and each element is valid attribute data.
在步骤103的执行过程中,按照第一数据组中各元素的排列顺序,依次读取每一个元素的值并判断是否为零,若为零则跳过,继续读取下一个元素的值;若不为零,则将该元素对应的有效属性数据写入第二数据组。In the execution process of step 103, according to the arrangement order of each element in the first data group, read the value of each element in turn and judge whether it is zero, if it is zero, skip, and continue to read the value of the next element; If it is not zero, write the valid attribute data corresponding to the element into the second data group.
图4为本申请实施例一提供的第二数据组与第一数据组之间的关系示意图。如图4所示,开辟一个存储空间用于存储第二数据组。首先读取元素0的值,当判断出为X时,表明该元素对应的属性为有效属性,从图元数据中读取对应的有效属性数据写入存储空间的0-3字节。第二次读取元素1的值,当判断出为X时,表明该元素对应的属性为有效属性,从图元数据中读取对应的有效属性数据写入存储空间的4-7字节。第三次读取元素2的值,当判断出为零时,跳过。执行第四次读取元素3的值,当判断出为零时,跳过。第五次读取元素4的值,当判断出为X时,表明该元素对应的属性为有效属性,从图元数据中读取对应的有效属性数据写入存储空间的8-11字节。第六次读取元素5的值,当判断出为零时,跳过。执行第七次读取元素6的值,当判断出为零时,跳过。第八次读取元素7的值,当判断出为X时,表明该元素对应的属性为有效属性,从图元数据中读取对应的有效属性数据写入存储空间的12-15字节。第九次读取元素8的值,当判断出为零时,跳过。第十次读取元素9的值,当判断出为X时,表明该元素对应的属性为有效属性,从图元数据中读取对应的有效属性数据写入存储空间的16-19字节。FIG. 4 is a schematic diagram of the relationship between the second data group and the first data group according to Embodiment 1 of the present application. As shown in FIG. 4, a storage space is allocated for storing the second data group. First read the value of element 0, when it is judged to be X, it indicates that the attribute corresponding to the element is a valid attribute, and the corresponding valid attribute data is read from the image metadata and written into 0-3 bytes of the storage space. The value of element 1 is read for the second time, and when it is determined to be X, it indicates that the attribute corresponding to the element is a valid attribute, and the corresponding valid attribute data is read from the image metadata and written into 4-7 bytes of the storage space. Read the value of element 2 for the third time, and skip it when it is judged to be zero. Execute the fourth time to read the value of element 3, when it is judged to be zero, skip. The value of element 4 is read for the fifth time. When it is determined to be X, it indicates that the attribute corresponding to the element is a valid attribute, and the corresponding valid attribute data is read from the image metadata and written into 8-11 bytes of the storage space. The value of element 5 is read for the sixth time, and when it is judged to be zero, it is skipped. Execute the seventh reading of the value of element 6, and skip when it is judged to be zero. The value of element 7 is read for the eighth time, and when it is determined to be X, it indicates that the attribute corresponding to the element is a valid attribute, and the corresponding valid attribute data is read from the image metadata and written into 12-15 bytes of the storage space. The value of element 8 is read for the ninth time, and when it is determined to be zero, it is skipped. The value of element 9 is read for the tenth time, and when it is determined to be X, it indicates that the attribute corresponding to the element is a valid attribute, and the corresponding valid attribute data is read from the image metadata and written into 16-19 bytes of the storage space.
经过上述操作之后,第二数据组中存储的都是有效属性数据,且各有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致。After the above operations, all valid attribute data are stored in the second data group, and the order in which each valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group.
步骤104、根据第一数据组和第二数据组中的数据生成图元数据包,并将图元数据包写入存储器;第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。Step 104: Generate a primitive data packet according to the data in the first data group and the second data group, and write the primitive data packet into the memory; the data in the first data group is used as the header of the primitive data packet, and the second data The data in the group acts as package data in the metapackage.
将上述第一数据组和第二数据组中的数据进行打包,生成图元数据包,第一数据组中的数据作为包头,第二数据组中的数据作为包数据。然后将图元数据包写入存储器。The data in the first data group and the data in the second data group are packaged to generate a primitive data package, the data in the first data group is used as the package header, and the data in the second data group is used as the package data. The metapackets are then written to memory.
本实施例提供的技术方案,首先获取待写入图形分块数据中的各图元数据,图元数据包括图元支持的所有属性的属性数据;然后根据图元数据生成与图元一一对应的第一数据组,第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性;根据图元数据生成与图元一一对应的第二数据组,第二数据组中的每一个元素为第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致;之后,根据第一数据组和第二数据组中的数据生成图元数据包,并将图元数据包写入存储器;第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。采用上述方案生成的第二数据组只包括图元含有的属性对应的有效属性数据,而图元不含有的属性对应的属性数据则不在第二数据组内,相当于第二数据组的数据量少于原始的图元数据,因此减少了向存储器写入的数据量,进而降低了处理器与存储器之间的带宽占用率。In the technical solution provided by this embodiment, each graphic element data to be written into the graphic block data is firstly obtained, and the graphic element data includes attribute data of all attributes supported by the graphic element; then a one-to-one correspondence with the graphic elements is generated according to the graphic metadata The first data group in the first data group, each element in the first data group is used to indicate whether the primitive contains an attribute; when the primitive contains an attribute, the attribute is a valid attribute; according to the primitive data, a one-to-one correspondence with the primitive is generated. The second data group, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data is stored continuously; the order in which the valid attribute data is arranged in the second data group corresponds to the corresponding valid attribute data The attributes are arranged in the same order in the first data group; after that, generate a primitive data packet according to the data in the first data group and the second data group, and write the primitive data packet into the memory; the data in the first data group As the header of the primitive data packet, the data in the second data group is regarded as the packet data in the primitive data packet. The second data group generated by the above solution only includes valid attribute data corresponding to the attributes contained in the graphic element, while the attribute data corresponding to the attributes not contained in the graphic element is not in the second data group, which is equivalent to the data volume of the second data group Less than the original primitive data, thus reducing the amount of data written to the memory, which in turn reduces the bandwidth usage between the processor and the memory.
实施例二Embodiment 2
本实施例是在上述实施例的基础上,对图形分块数据写入方法进行优化,尤其是提供一种根据图元数据生成第一数据组和第二数据组的具体实现方式。This embodiment optimizes the method for writing graphics block data on the basis of the above-mentioned embodiments, and especially provides a specific implementation manner of generating a first data group and a second data group according to graphic metadata.
上述步骤102具体可以采用如下方式实现:The above step 102 can be specifically implemented in the following manner:
首先,配置与图元一一对应的第一寄存器R0,第一寄存器的位数N与图元所支持的属性数目相同。图5为本申请实施例二提供的第一寄存器的示意图。如图5所示,假设图元支持10个属性,则配置第一寄存器的位数为10。First, configure the first register R0 corresponding to the primitives one-to-one, and the number of bits N of the first register is the same as the number of attributes supported by the primitives. FIG. 5 is a schematic diagram of a first register provided in Embodiment 2 of the present application. As shown in FIG. 5 , assuming that the primitive supports 10 attributes, the number of bits in the first register is 10.
然后根据图元数据向第一寄存器写入数据,第一寄存器中的每一位作为一个元素,第一寄存器中的所有位构成第一数据组。Then, data is written into the first register according to the primitive data, each bit in the first register is used as an element, and all the bits in the first register constitute a first data group.
当第一寄存器中的某一位为“1”时,表示图元包含一个属性,该属性为有效属性。当第一寄存器中的某一位为“0”时,表示图元不含有一个属性,该属性为无效属性。When a certain bit in the first register is "1", it means that the graphic element contains an attribute, and the attribute is a valid attribute. When a certain bit in the first register is "0", it means that the graphic element does not contain an attribute, and the attribute is an invalid attribute.
本实施例中的第一寄存器仅用于举例说明,实际应用中,第一寄存器的位数并不限定于10位,可根据图元所支持的最大属性数目进行设定。The first register in this embodiment is only used for illustration. In practical applications, the number of bits of the first register is not limited to 10 bits, and can be set according to the maximum number of attributes supported by the graphic element.
上述步骤103具体可以采用如下方式实现:The above step 103 can be specifically implemented in the following manner:
首先,配置与图元一一对应的第二寄存器R1。第二寄存器R1的位数可根据图元数据进行设定。本实施例提供一种具体方式:当第一寄存器R0的位数为N时,假定每一个有效属性数据占用四个字节,则第二寄存器R1可支持的最大位数为N*4*8。First, configure the second register R1 corresponding to the primitives one-to-one. The number of bits of the second register R1 can be set according to the primitive data. This embodiment provides a specific method: when the number of bits of the first register R0 is N, assuming that each valid attribute data occupies four bytes, the maximum number of bits that the second register R1 can support is N*4*8 .
其次,根据图元数据向第二寄存器写入数据,第二寄存器中的每个预设长度数据作为一个元素,第二寄存器的所有元素组成第二数据组。例如:预设长度为4个字节,4个字节的数据作为一个元素,用于存储一个有效属性数据。Next, data is written into the second register according to the primitive data, each preset length data in the second register is used as an element, and all elements of the second register form a second data group. For example: the preset length is 4 bytes, and 4 bytes of data are used as an element to store a valid attribute data.
具体的,按照第一寄存器R0的位数从低到高的顺序,依次判断某一位是不是为“1”,若为“1”,则将该位对应的有效属性数据写入第二寄存器R1中。每个有效属性数据连续写入。假设第一寄存器R0中数值为“1”的个数C,则第二寄存器R1的有效位数为C*4*8。当C小于N时,第二寄存器R1的位数小于图元数据的位数。Specifically, according to the order of the number of bits of the first register R0 from low to high, it is judged whether a certain bit is "1" in turn, and if it is "1", the valid attribute data corresponding to the bit is written into the second register. in R1. Each valid attribute data is written continuously. Assuming that the number C of the first register R0 whose value is "1", the effective number of digits of the second register R1 is C*4*8. When C is smaller than N, the number of bits of the second register R1 is smaller than that of the primitive data.
图6为本申请实施例二提供的第二寄存器与第一寄存器之间的关系示意图。如图6所示,假设第一寄存器R0的位数是10。R0中第0位为“1”,表明该元素对应的属性为有效属性,从图元数据中读取对应的有效属性数据写入第二寄存器的0-3字节。第1位为“1”,将对应的有效属性数据写入存储空间的4-7字节。第2位为“0”,跳过。第3位为“0”,跳过。第4位为“1”,将对应的有效属性数据写入存储空间的8-11字节。第5位为“0”,跳过。第6位为“0”,跳过。第7位为“1”,将有效属性数据写入存储空间的12-15字节。 第8位为“0”,跳过。第9位为“1”,将有效属性数据写入存储空间的16-19字节。FIG. 6 is a schematic diagram of the relationship between the second register and the first register according to Embodiment 2 of the present application. As shown in FIG. 6 , it is assumed that the number of bits of the first register R0 is 10. The 0th bit in R0 is "1", indicating that the attribute corresponding to the element is a valid attribute, and the corresponding valid attribute data is read from the image metadata and written into the 0-3 bytes of the second register. The first bit is "1", and the corresponding valid attribute data is written into the 4-7 bytes of the storage space. Bit 2 is "0", skip. Bit 3 is "0", skip. The fourth bit is "1", and the corresponding valid attribute data is written into the 8-11 bytes of the storage space. Bit 5 is "0", skip. Bit 6 is "0", skip. Bit 7 is "1", writing valid attribute data to 12-15 bytes of storage space. Bit 8 is "0", skip. Bit 9 is "1", writing valid attribute data to bytes 16-19 of the storage space.
经过上述操作之后,第二寄存器R1中存储的都是有效属性数据,且各有效属性数据在第二寄存器R1中排列的顺序与对应有效属性在第一寄存器R0中排列的顺序一致。After the above operations, all valid attribute data are stored in the second register R1, and the order in which each valid attribute data is arranged in the second register R1 is consistent with the order in which the corresponding valid attributes are arranged in the first register R0.
第一寄存器R0的位数为图元所支持的属性数目相同,图元数据包含所支持的所有属性的属性数据,因此,本示例中图元数据的有效位数为10*4*8,第二寄存器R1的有效位数为5*4*8。与图元数据相比,第二寄存器R1少了5个字节。因此,在向存储器写入的过程中少写5个字节的数据,能够减少一半的带宽占用率。The number of bits of the first register R0 is the same as the number of attributes supported by the primitive, and the primitive data contains the attribute data of all the supported attributes. Therefore, in this example, the effective number of digits of the primitive data is 10*4*8, The effective number of bits of the second register R1 is 5*4*8. Compared with the primitive data, the second register R1 is 5 bytes less. Therefore, in the process of writing to the memory, writing 5 bytes of data can reduce the bandwidth occupancy by half.
实施例三Embodiment 3
本实施例是在上述实施例的基础上,对图形分块数据写入方法进行进一步的优化。This embodiment further optimizes the method for writing graphics block data on the basis of the above-mentioned embodiment.
图7为本申请实施例三提供的图形分块数据写入方法的流程图。如图7所示,本实施例提供的图形分块数据写入方法包括:FIG. 7 is a flowchart of a method for writing graphics block data according to Embodiment 3 of the present application. As shown in FIG. 7 , the method for writing graphics block data provided by this embodiment includes:
步骤201、获取待写入图形分块数据中的各图元数据,图元数据包括图元支持的所有属性的属性数据。Step 201: Acquire each graphic element data to be written in the graphic block data, where the graphic element data includes attribute data of all attributes supported by the graphic element.
步骤202、根据图元数据生成与图元一一对应的第一数据组,第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性。Step 202: Generate a first data group corresponding to the graphic element one-to-one according to the graphic element data, and each element in the first data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is valid. Attributes.
步骤203、根据图元数据生成与图元一一对应的第二数据组,第二数据组中的每一个元素为第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致。 Step 203, generating a second data group corresponding to the primitives one-to-one according to the graphic element data, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data is stored continuously; The order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group.
步骤204、根据第一数据组和第二数据组中的数据生成图元数据包,并将 图元数据包写入存储器;第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。Step 204: Generate a primitive data packet according to the data in the first data group and the second data group, and write the primitive data packet into the memory; the data in the first data group is used as the header of the primitive data packet, and the second data The data in the group acts as package data in the metapackage.
上述步骤201至步骤204的实现方式可参照上述实施例一中的步骤101至步骤104,本实施例不再赘述。For the implementation manner of the above steps 201 to 204, reference may be made to the steps 101 to 104 in the above-mentioned first embodiment, which will not be repeated in this embodiment.
在步骤204之后,还可以执行步骤205:After step 204, step 205 may also be performed:
步骤205、将图元数据包在存储器中的存储地址写入随机存取存储器RAM中的预设存储区域内,并替换预设存储区域内的原数据;一个图形分块数据中的各图元的图元数据包对应的存储地址写入同一个预设存储区域。 Step 205, write the storage address of the primitive data packet in the memory into the preset storage area in the random access memory RAM, and replace the original data in the preset storage area; each graphic element in the graphics block data The storage address corresponding to the primitive data package is written into the same preset storage area.
随机存取存储器(Random Access Memory,简称:RAM)可以为GPU的片上RAM,也可以为片外RAM。Random Access Memory (Random Access Memory, RAM for short) can be on-chip RAM of GPU or off-chip RAM.
对一帧图形的每一个分块数据都在RAM中分配一个存储区域,作为预设存储区域,并写入初始分配地址。For each block data of a frame of graphics, a storage area is allocated in the RAM as a preset storage area, and the initial allocation address is written.
在对每一个分块数据进行处理的过程中,经过上述步骤201至步骤204得到一个图元对应的图元数据包。对第一次得到的图元数据包在存储器中的存储地址写入RAM中的预设存储区域,并替换初始分配地址,相当于该预设存储区域中当前存储的数据为图元数据包的存储地址。In the process of processing each piece of data, a graphic element data package corresponding to a graphic element is obtained through the above steps 201 to 204 . Write the storage address of the primitive data packet in the memory obtained for the first time into the preset storage area in the RAM, and replace the initial allocation address, which is equivalent to the data currently stored in the preset storage area. storage address.
在执行完成上述步骤201至205之后,再获取下一个图元数据,重复执行上述步骤201至205,直至一个分块数据中的所有图元数据全部处理完成并写入存储器及地址写入RAM。After the above steps 201 to 205 are completed, the next primitive data is obtained, and the above steps 201 to 205 are repeatedly executed until all the primitive data in a block of data are processed and written into the memory and addresses are written into the RAM.
后续每处理得到一个图元数据包,就将该图元数据包在存储器中的存储地址写入RAM的预设存储区域,并替换上一次写入的存储地址。After each subsequent processing obtains a primitive data packet, the storage address of the primitive data packet in the memory is written into the preset storage area of the RAM, and the previously written storage address is replaced.
实施例四Embodiment 4
本实施例提供一种图形分块数据读取方法,可以由处理器来执行,尤其是由图形处理器GPU来执行。本实施例提供的方法是与上述实施例一所提供的数据写入方式对应的数据读出方式,能够降低处理器与存储器之间的带宽占用 率。This embodiment provides a method for reading graphics block data, which can be executed by a processor, especially a graphics processor GPU. The method provided in this embodiment is a data reading method corresponding to the data writing method provided in the above-mentioned first embodiment, which can reduce the bandwidth occupancy rate between the processor and the memory.
在一个分块数据中的所有图元数据均写入存储器之后,可执行本实施例所提供的从存储器读出数据,并进行渲染的方案。当然,本实施例所提供的方案也不限定于对图形进行渲染,任何对图形数据进行分块处理的场景都适用。After all the primitive data in a piece of data are written into the memory, the solution of reading data from the memory and rendering provided in this embodiment can be performed. Of course, the solution provided in this embodiment is not limited to rendering graphics, and is applicable to any scenario in which graphics data is processed in blocks.
图8为本申请实施例四提供的图形分块数据读取方法的流程图。如图8所示,本实施例提供的图形分块数据读取方法包括:FIG. 8 is a flowchart of a method for reading graphic block data according to Embodiment 4 of the present application. As shown in FIG. 8 , the method for reading graphic block data provided by this embodiment includes:
步骤301、从存储器读出图元数据包,并解析得到包头和包数据。 Step 301 , read the primitive data packet from the memory, and parse to obtain the packet header and packet data.
依次从存储器读出分块数据中的各图元数据包,在读取一个图元数据包之后,按照预设的数据打包规则解析得到包头和包数据。预设的数据打包规则为实施例一中将第一数据组的数据作为包头,将第二数据组的数据作为包数据的方式。Each graphic element data packet in the block data is sequentially read from the memory, and after reading a graphic element data packet, the packet header and the packet data are obtained by parsing according to a preset data packing rule. The preset data packing rule is the manner in which the data of the first data group is used as the packet header and the data of the second data group is used as the packet data in the first embodiment.
步骤302、根据包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性。Step 302: Generate a third data group according to the packet header, and each element in the third data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is a valid attribute.
将包头解析出来之后,根据包头生成第三数据组。第三数据组包含多个元素,每一个元素用于表示图元是否含有一个属性。第三数据组的构成可参照上述实施例中第一数据组。After the packet header is parsed out, a third data group is generated according to the packet header. The third data group includes a plurality of elements, and each element is used to indicate whether the primitive contains an attribute. For the composition of the third data set, reference may be made to the first data set in the above-mentioned embodiment.
步骤303、根据包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据。Step 303: Generate a fourth data group according to the packet data, and each element in the fourth data group is a valid attribute data.
将包数据解析出来之后,根据包数据生成第四数据组。第四数据组包含多个元素,每一个元素为第三数据组中有效属性对应的有效属性数据。第四数据组的构成可参照上述实施例中的第二数据组。每一个元素After the packet data is parsed out, a fourth data group is generated according to the packet data. The fourth data group includes a plurality of elements, and each element is valid attribute data corresponding to the valid attributes in the third data group. For the composition of the fourth data set, reference may be made to the second data set in the above embodiment. every element
步骤304、按照第三数据组中有效属性的排列顺序,依次从第四数据组中读一个元素的数据作为与有效属性对应的有效属性数据。Step 304: According to the arrangement order of the valid attributes in the third data group, sequentially read data of one element from the fourth data group as valid attribute data corresponding to the valid attributes.
根据第二数据组的数据存储规则,第四数据组中每一个元素对应一个有效属性数据,且各元素在第四数据组中的排列顺序与第三数据组中各有效属性的排列顺序一致。因此,步骤304中,按照第三数据组中各有效属性的排列顺序, 从第四数据组中读取各元素,作为与有效属性对应的有效属性数据。每一个元素可以为预设长度的数据。According to the data storage rules of the second data group, each element in the fourth data group corresponds to one valid attribute data, and the arrangement order of the elements in the fourth data group is consistent with the arrangement order of the valid attributes in the third data group. Therefore, in step 304, each element is read from the fourth data group according to the arrangement order of each valid attribute in the third data group, as valid attribute data corresponding to the valid attribute. Each element can be data of a preset length.
在读出一个有效属性对应的有效属性数据之后,可以根据该有效属性数据对图形进行渲染。After reading out the valid attribute data corresponding to a valid attribute, the graphics can be rendered according to the valid attribute data.
本实施例提供的技术方案,采用从存储器读出图元数据包,并解析得到包头和包数据;根据包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,该属性为有效属性;根据包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据;按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取一个元素的数据作为与有效属性对应的有效属性数据;由于图元数据包中的第四数据组的数据量会少于传统方案中的图元数据,因此能够减少从存储器中读出的数据量,进而降低了对处理器与存储器之间带宽的占用率。In the technical solution provided by this embodiment, the primitive data packet is read from the memory, and the packet header and packet data are obtained by parsing; a third data group is generated according to the packet header, and each element in the third data group is used to indicate whether the primitive contains An attribute; when the graphic element contains an attribute, the attribute is a valid attribute; the fourth data group is generated according to the packet data, and each element in the fourth data group is a valid attribute data; according to the valid attributes in the third data group Arrangement order, sequentially read the data of one element from the fourth data group as the effective attribute data corresponding to the effective attribute; because the data volume of the fourth data group in the primitive data package will be less than the primitive data in the traditional scheme , so the amount of data read out from the memory can be reduced, thereby reducing the occupancy rate of the bandwidth between the processor and the memory.
实施例五Embodiment 5
本实施例是在上述实施例的基础上,对图形分块数据读取方法进行优化,尤其是提供一种生成第三数据组和第四数据组的实现方式。This embodiment optimizes the method for reading graphic block data on the basis of the above-mentioned embodiments, and especially provides an implementation manner of generating a third data set and a fourth data set.
上述步骤302具体可采用如下方式实现:The above-mentioned step 302 can be specifically implemented in the following manner:
首先,配置与图元一一对应的第三寄存器R2,第三寄存器R2的位数N与图元所支持的属性数目相同。第三寄存器R2可以与第一寄存器R0是相同的。假设图元支持10个属性,则配置第三寄存器的位数为10。First, configure a third register R2 corresponding to the primitives one-to-one, and the number of bits N of the third register R2 is the same as the number of attributes supported by the primitives. The third register R2 may be the same as the first register R0. Assuming that the primitive supports 10 attributes, the number of bits in the configuration third register is 10.
然后,将包头写入第三寄存器R2,第三寄存器R2中的每一位作为一个元素,第三寄存器R2的所有位组成第三数据组。当第三寄存器中的某一位为“1”时,表示图元包含一个属性,该属性为有效属性。当第三寄存器中的某一位为“0”时,表示图元不含有一个属性,该属性为无效属性。Then, the packet header is written into the third register R2, each bit in the third register R2 is used as an element, and all the bits in the third register R2 form a third data group. When a certain bit in the third register is "1", it means that the primitive contains an attribute, and the attribute is a valid attribute. When a certain bit in the third register is "0", it means that the graphic element does not contain an attribute, and the attribute is an invalid attribute.
本实施例中的第三寄存器仅用于举例说明,实际应用中,第三寄存器的位数并不限定于10位,可根据图元所支持的最大属性数目进行设定。The third register in this embodiment is only used for illustration. In practical applications, the number of bits of the third register is not limited to 10 bits, and can be set according to the maximum number of attributes supported by the graphic element.
上述步骤303具体可采用如下方式实现:The above step 303 can be specifically implemented in the following manner:
首先,配置与图元一一对应的第四寄存器R3。当第三寄存器R2的位数为N时,假定每一个有效属性数据占用四个字节,则第四寄存器R3可支持的最大位数为N*4*8。First, the fourth register R3 corresponding to the primitives one-to-one is configured. When the number of bits of the third register R2 is N, assuming that each valid attribute data occupies four bytes, the maximum number of bits that the fourth register R3 can support is N*4*8.
其次,将包数据写入第四寄存器R3,第四寄存器R3中每个预设长度的数据作为一个元素。具体的,按照地址从低到高的顺序,四个字节作为一个元素,用于表示有效属性数据。Next, the packet data is written into the fourth register R3, and each preset length of data in the fourth register R3 is taken as an element. Specifically, in the order of addresses from low to high, four bytes are used as one element to represent valid attribute data.
经过上述步骤之后,执行上述步骤304,具体是按照第三寄存器R2中有效属性的排列顺序,依次从第四寄存器R3中读取对应的有效属性数据。例如:按照第三寄存器R2的位数从低到高的顺序,第0位为“1”,将第四寄存器R3中第0-3字节的数据取出作为有效属性数据并进行渲染。第1位为“1”,将第四寄存器R3中第4-7字节的数据取出作为有效属性数据并进行渲染。第2位和第3位为“0”,跳过。第4位为“1”,将第四寄存器R3中第8-11字节的数据取出作为有效属性数据并进行渲染。第5位和第6位为“0”,跳过。第7位为“1”,将第四寄存器R3中第12-15字节的数据取出作为有效属性数据并进行渲染。第8位为“0”,跳过。第9位为“1”,将第四寄存器R3中第16-19字节的数据取出作为有效属性数据并进行渲染。After the above steps, the above step 304 is executed, specifically, according to the arrangement order of the valid attributes in the third register R2, the corresponding valid attribute data is sequentially read from the fourth register R3. For example, according to the order of the number of bits of the third register R2 from low to high, the 0th bit is "1", and the data of the 0-3 bytes in the fourth register R3 is taken out as valid attribute data and rendered. The first bit is "1", and the data of the 4th to 7th bytes in the fourth register R3 is taken out as valid attribute data and rendered. Bits 2 and 3 are "0" and skipped. The fourth bit is "1", and the data of the 8th to 11th bytes in the fourth register R3 is taken out as valid attribute data and rendered. Bits 5 and 6 are "0", skip. The seventh bit is "1", and the data of the 12th to 15th bytes in the fourth register R3 is taken out as valid attribute data and rendered. Bit 8 is "0", skip. The ninth bit is "1", and the data of bytes 16-19 in the fourth register R3 is taken out as valid attribute data and rendered.
实施例六Embodiment 6
本实施例是在上述实施例的基础上,对图形分块数据读取方法进行进一步的优化。This embodiment further optimizes the method for reading graphics block data on the basis of the above-mentioned embodiment.
图9为本申请实施例六提供的图形分块数据读取方法的流程图。如图9所示,本实施例提供的图形分块数据读取方法,在上述步骤301之前,还包括如下几个步骤:FIG. 9 is a flowchart of a method for reading graphic block data according to Embodiment 6 of the present application. As shown in FIG. 9 , the method for reading graphic block data provided by this embodiment further includes the following steps before step 301:
步骤305、从随机存取存储器RAM的预设存储区域内读取当前地址数据。Step 305: Read the current address data from the preset storage area of the random access memory RAM.
与上述实施例三对应的,对一帧图形的每一个分块数据都在RAM中分配一个存储区域,作为预设存储区域。预设存储区域中写入一个初始分配地址。在后续每个图元数据写入存储器之后,将图元数据在存储器中的存储地址写入该预设存储区域,并替换原数据。Corresponding to the third embodiment above, a storage area is allocated in the RAM for each block data of a frame of graphics as a preset storage area. An initial allocation address is written in the preset memory area. After each subsequent primitive data is written into the memory, the storage address of the primitive data in the memory is written into the preset storage area, and the original data is replaced.
该步骤即为读取预设存储区域内存储的当前地址数据。This step is to read the current address data stored in the preset storage area.
步骤306、判断当前地址数据是否与预设存储区域内初始分配的地址不同。Step 306: Determine whether the current address data is different from the address initially allocated in the preset storage area.
具体是判断预设存储区域的内容是否被更新过,若当前地址数据与初始分配地址相同,相当于未被更新过,则可以结束当前步骤,转而执行获取下一个预设存储区域当前地址数据的操作。Specifically, it is judged whether the content of the preset storage area has been updated. If the current address data is the same as the initial allocated address, which means that it has not been updated, the current step can be ended, and the execution of obtaining the current address data of the next preset storage area is performed. operation.
若当前地址数据与初始分配地址不相同,表明预设存储区域的内容被更新过,则执行步骤301至步骤304。If the current address data is different from the initial allocated address, it indicates that the content of the preset storage area has been updated, and then steps 301 to 304 are executed.
采用本实施例提供的方案,在判断出预设存储区域内的内容被更新过,才读取图元数据,相当于对图元数据进行处理过的数据才进行读取,能够提高对图元数据处理的效率,避免执行无效操作。Using the solution provided in this embodiment, the graphic metadata is read only after it is determined that the content in the preset storage area has been updated, which is equivalent to reading the data that has been processed on the graphic metadata, which can improve the accuracy of the graphic metadata. Efficiency of data processing to avoid performing invalid operations.
实施例七Embodiment 7
图10为本申请实施例七提供的图形分块数据读写方法的流程图。如图10所示,本实施例在上述实施例在上述各实施例的基础上,提供一种图形分块数据读写方法,包括:FIG. 10 is a flowchart of a method for reading and writing data in graphic blocks provided by Embodiment 7 of the present application. As shown in FIG. 10 , the present embodiment provides a method for reading and writing graphic block data on the basis of the above-mentioned embodiments, including:
步骤401、获取待写入图形分块数据中的各图元数据,图元数据包括图元支持的所有属性的属性数据。Step 401: Acquire each graphic element data to be written in the graphic block data, where the graphic element data includes attribute data of all attributes supported by the graphic element.
步骤402、根据图元数据生成与图元一一对应的第一数据组,第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性。Step 402: Generate a first data group corresponding to the graphic element one-to-one according to the graphic element data, and each element in the first data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is valid. Attributes.
步骤403、根据图元数据生成与图元一一对应的第二数据组,第二数据组中的每一个元素为第一数据组中有效属性对应的有效属性数据,各有效属性数 据连续存储;有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致。 Step 403, generating a second data group corresponding to the primitives one-to-one according to the graphic element data, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data is stored continuously; The order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group.
步骤404、根据第一数据组和第二数据组中的数据生成图元数据包,并将图元数据包写入存储器;第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。Step 404: Generate a primitive data packet according to the data in the first data group and the second data group, and write the primitive data packet into the memory; the data in the first data group is used as the header of the primitive data packet, and the second data The data in the group acts as package data in the metapackage.
步骤405、将图元数据包在存储器中的存储地址写入随机存取存储器RAM中的预设存储区域内,并替换预设存储区域内的原数据;一个图形分块数据中的各图元的图元数据包对应的存储地址写入同一个预设存储区域。 Step 405, write the storage address of the primitive data packet in the memory into the preset storage area in the random access memory RAM, and replace the original data in the preset storage area; each graphic element in a graphics block data The storage address corresponding to the primitive data package is written into the same preset storage area.
以上各步骤的实现方式可参照上述实施例的内容。For the implementation of the above steps, reference may be made to the content of the above embodiments.
在一个分块数据中的多个图元数据都写入存储器之后,可以执行步骤406:After a plurality of primitive data in one block of data are written into the memory, step 406 may be performed:
步骤406、从随机存取存储器RAM的预设存储区域内读取当前地址数据。Step 406: Read the current address data from the preset storage area of the random access memory RAM.
步骤407、当判断出当前地址数据与预设存储区域内初始分配的地址不同时,从存储器读出图元数据包,并解析得到包头和包数据。Step 407: When it is determined that the current address data is different from the address initially allocated in the preset storage area, read the primitive data packet from the memory, and parse to obtain the packet header and the packet data.
步骤408、根据包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性。Step 408: Generate a third data group according to the packet header, and each element in the third data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is a valid attribute.
步骤409、根据包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据。Step 409: Generate a fourth data group according to the packet data, and each element in the fourth data group is a valid attribute data.
步骤410、按照第三数据组中有效属性的排列顺序,依次从第四数据组中读一个元素的数据作为与有效属性对应的有效属性数据。Step 410: According to the arrangement order of the valid attributes in the third data group, sequentially read the data of one element from the fourth data group as the valid attribute data corresponding to the valid attributes.
本实施例提供的技术方案,生成的第二数据组只包括图元含有的属性对应的有效属性数据,而图元不含有的属性对应的属性数据则不在第二数据组内,相当于第二数据组的数据量少于原始的图元数据,因此减少了向存储器写入的数据量,进而降低了处理器与存储器之间的带宽占用率。相应的,从存储器中读取的数据量也减少了,进一步降低了处理器与存储器之间的带宽占用率。In the technical solution provided by this embodiment, the generated second data group only includes valid attribute data corresponding to the attributes contained in the graphic element, while the attribute data corresponding to the attributes not contained in the graphic element is not in the second data group, which is equivalent to the second data group. The data volume of the data group is less than the original primitive data, thus reducing the amount of data written to the memory, thereby reducing the bandwidth usage between the processor and the memory. Correspondingly, the amount of data read from the memory is also reduced, further reducing the bandwidth occupancy rate between the processor and the memory.
实施例八Embodiment 8
图11为本申请实施例八提供的图形分块数据写入装置的结构示意图。如图11所示,本实施例提供一种图形分块数据写入装置,包括:图元数据获取模块51、第一数据组生成模块52、第二数据组生成模块53、图元数据包生成模块54和图元数据包写入模块55。FIG. 11 is a schematic structural diagram of a graphics block data writing apparatus according to Embodiment 8 of the present application. As shown in FIG. 11 , this embodiment provides a graphics block data writing device, including: a graphics metadata acquisition module 51 , a first data group generation module 52 , a second data group generation module 53 , and a graphics metadata packet generation module Module 54 and Metadata Packet Write Module 55.
其中,图元数据获取模块51用于获取待写入图形分块数据中的各图元数据,图元数据包括图元支持的所有属性的属性数据。第一数据组生成模块52用于根据图元数据生成与图元一一对应的第一数据组,第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性。第二数据组生成模块53用于根据图元数据生成与图元一一对应的第二数据组,第二数据组中的每一个元素为第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致。图元数据包生成模块54用于根据第一数据组和第二数据组中的数据生成图元数据包;第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。图元数据包写入模块55用于将图元数据包写入存储器。The graphic metadata acquisition module 51 is configured to acquire each graphic metadata to be written into the graphic block data, and the graphic metadata includes attribute data of all attributes supported by the graphic element. The first data group generation module 52 is used to generate a first data group corresponding to the primitives one-to-one according to the primitive data, and each element in the first data group is used to indicate whether the primitives contain an attribute; when the primitives contain a property, the property is a valid property. The second data group generation module 53 is configured to generate a second data group corresponding to the primitives one-to-one according to the primitive data. Each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group. The valid attribute data are stored continuously; the order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group. The primitive data packet generating module 54 is configured to generate a primitive data packet according to the data in the first data group and the second data group; the data in the first data group is used as the header of the primitive data packet, and the data in the second data group as package data in a metadata package. The primitive data packet writing module 55 is used for writing the primitive data packet into the memory.
本实施例提供的技术方案,首先获取待写入图形分块数据中的各图元数据,图元数据包括图元支持的所有属性的属性数据;然后根据图元数据生成与图元一一对应的第一数据组,第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性;根据图元数据生成与图元一一对应的第二数据组,第二数据组中的每一个元素为第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致;之后,根据第一数据组和第二数据组中的数据生成图元数据包,并将图元数据包写入存储器;第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。采用上述方案生成的第二数据组只包括图元含有的属性对应的有效属性数据,而图元不含有的属性对应的属性数据则不在第二数据 组内,相当于第二数据组的数据量少于原始的图元数据,因此减少了向存储器写入的数据量,进而降低了处理器与存储器之间的带宽占用率。In the technical solution provided by this embodiment, each graphic element data to be written into the graphic block data is firstly obtained, and the graphic element data includes attribute data of all attributes supported by the graphic element; then a one-to-one correspondence with the graphic elements is generated according to the graphic metadata The first data group in the first data group, each element in the first data group is used to indicate whether the primitive contains an attribute; when the primitive contains an attribute, the attribute is a valid attribute; according to the primitive data, a one-to-one correspondence with the primitive is generated. The second data group, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data is stored continuously; the order in which the valid attribute data is arranged in the second data group corresponds to the corresponding valid attribute data The attributes are arranged in the same order in the first data group; after that, generate a primitive data packet according to the data in the first data group and the second data group, and write the primitive data packet into the memory; the data in the first data group As the header of the primitive data packet, the data in the second data group is regarded as the packet data in the primitive data packet. The second data group generated by the above solution only includes valid attribute data corresponding to the attributes contained in the graphic element, while the attribute data corresponding to the attributes not contained in the graphic element is not in the second data group, which is equivalent to the data volume of the second data group Less than the original primitive data, thus reducing the amount of data written to the memory, which in turn reduces the bandwidth usage between the processor and the memory.
在上述技术方案的基础上,第一数据组生成模块,包括:第一寄存器配置单元和第一寄存器写入单元。其中,第一寄存器配置单元用于配置与图元一一对应的第一寄存器,第一寄存器的位数与图元所支持的属性数目相同。第一寄存器写入单元用于根据图元数据向第一寄存器写入数据,第一寄存器中的每一位作为一个元素,第一寄存器的所有位组成第一数据组。Based on the above technical solution, the first data group generation module includes: a first register configuration unit and a first register writing unit. Wherein, the first register configuration unit is used to configure the first registers corresponding to the primitives one-to-one, and the number of bits of the first register is the same as the number of attributes supported by the primitives. The first register writing unit is used for writing data into the first register according to the primitive data, each bit in the first register is used as an element, and all the bits in the first register form a first data group.
第二数据组生成模块,包括:第二寄存器配置单元和第二寄存器配置单元。第二寄存器配置单元用于配置与图元一一对应的第二寄存器。第二寄存器配置单元用于根据图元数据向第二寄存器写入数据,第二寄存器中的每个预设长度数据作为一个元素,第二寄存器的所有元素组成第二数据组。The second data group generation module includes: a second register configuration unit and a second register configuration unit. The second register configuration unit is configured to configure the second registers corresponding to the primitives one-to-one. The second register configuration unit is configured to write data into the second register according to the primitive data, each preset length data in the second register is used as an element, and all elements of the second register form a second data group.
另外,图形分块数据写入装置还包括:地址写入模块,用于将图元数据包在存储器中的存储地址写入随机存取存储器RAM中的预设存储区域内,并替换预设存储区域内的原数据;一个图形分块数据中的各图元的图元数据包对应的存储地址写入同一个预设存储区域。In addition, the graphics block data writing device further includes: an address writing module, configured to write the storage address of the primitive data packet in the memory into the preset storage area in the random access memory RAM, and replace the preset storage The original data in the area; the storage addresses corresponding to the primitive data packets of each primitive in a graphic block data are written into the same preset storage area.
实施例九Embodiment 9
图12为本申请实施例九提供的图形分块数据读取装置的结构示意图。如图12所示,本实施例提供另一种图形分块数据读取装置,包括:图元数据包读出模块61、第三数据组生成模块62、第四数据组生成模块63和有效属性数据读取模块64。FIG. 12 is a schematic structural diagram of a graphics block data reading apparatus according to Embodiment 9 of the present application. As shown in FIG. 12 , this embodiment provides another device for reading graphics block data, including: a graphics metadata packet reading module 61 , a third data group generation module 62 , a fourth data group generation module 63 , and a valid attribute Data reading module 64 .
其中,图元数据包读出模块61用于从存储器读出图元数据包,并解析得到包头和包数据。第三数据组生成模块62用于根据包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,属性为有效属性。第四数据组生成模块63用于根据包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据。有效属性数据读取模 块64用于按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取预设长度的数据作为与有效属性对应的有效属性数据。Among them, the primitive data packet reading module 61 is used for reading out the primitive data packet from the memory, and parses to obtain the packet header and the packet data. The third data group generating module 62 is configured to generate a third data group according to the packet header, and each element in the third data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is a valid attribute. The fourth data group generating module 63 is configured to generate a fourth data group according to the packet data, and each element in the fourth data group is a valid attribute data. The effective attribute data reading module 64 is configured to sequentially read data of a preset length from the fourth data group as effective attribute data corresponding to the effective attributes according to the arrangement order of the effective attributes in the third data group.
本实施例提供的技术方案,采用从存储器读出图元数据包,并解析得到包头和包数据;根据包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,该属性为有效属性;根据包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据;按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取一个元素的数据作为与有效属性对应的有效属性数据;由于图元数据包中的第四数据组的数据量会少于传统方案中的图元数据,因此能够减少从存储器中读出的数据量,进而降低了对处理器与存储器之间带宽的占用率。In the technical solution provided by this embodiment, the primitive data packet is read from the memory, and the packet header and packet data are obtained by parsing; a third data group is generated according to the packet header, and each element in the third data group is used to indicate whether the primitive contains An attribute; when the graphic element contains an attribute, the attribute is a valid attribute; the fourth data group is generated according to the packet data, and each element in the fourth data group is a valid attribute data; according to the valid attributes in the third data group Arrangement order, sequentially read the data of one element from the fourth data group as the effective attribute data corresponding to the effective attribute; because the data volume of the fourth data group in the primitive data package will be less than the primitive data in the traditional scheme , so the amount of data read out from the memory can be reduced, thereby reducing the occupancy rate of the bandwidth between the processor and the memory.
上述第三数据组生成模块,包括:第三寄存器配置单元和第三寄存器写入单元。其中,第三寄存器配置单元用于配置与图元一一对应的第三寄存器,第三寄存器的位数与图元所支持的属性数目相同。第三寄存器写入单元用于将包头写入第三寄存器,第三寄存器中的每一位作为一个元素,第一寄存器的所有位组成第三数据组。The above-mentioned third data group generating module includes: a third register configuration unit and a third register writing unit. Wherein, the third register configuration unit is used to configure a third register corresponding to the primitives one-to-one, and the number of bits of the third register is the same as the number of attributes supported by the primitives. The third register writing unit is used to write the packet header into the third register, each bit in the third register is used as an element, and all the bits in the first register form a third data group.
第四数据组生成模块包括:第四寄存器配置单元和第四寄存器写入单元。第四寄存器配置单元用于配置与图元一一对应的第四寄存器。第四寄存器写入单元用于将包数据写入第四寄存器,第四寄存器中没有预设长度的数据作为一个元素。The fourth data group generating module includes: a fourth register configuration unit and a fourth register writing unit. The fourth register configuration unit is used to configure the fourth registers corresponding to the primitives one-to-one. The fourth register writing unit is used to write the packet data into the fourth register, and the data without preset length in the fourth register is taken as one element.
另外,图形分块数据读取装置还包括:地址数据读取模块和地址判断模块。地址数据读取模块用于从随机存取存储器RAM的预设存储区域内读取当前地址数据。地址判断模块用于判断当前地址数据是否与预设存储区域内初始分配的地址不同,若不同,则触发图元数据包读出模块的操作。In addition, the graphic block data reading device further includes: an address data reading module and an address judging module. The address data reading module is used for reading the current address data from the preset storage area of the random access memory RAM. The address judgment module is used for judging whether the current address data is different from the initially allocated address in the preset storage area, and if it is different, the operation of the primitive data packet reading module is triggered.
实施例十Embodiment ten
图13为本申请实施例十提供的图形分块数据读写系统的结构示意图。如 图13所示,本实施例提供一种图形分块数据读写系统,包括:如上述实施例八任一内容所提供的图形分块数据写入装置71和/或如上述实施例九任一内容所提供的图形分块数据读取装置72。FIG. 13 is a schematic structural diagram of a graphic block data reading and writing system provided by Embodiment 10 of the present application. As shown in FIG. 13, this embodiment provides a graphics block data reading and writing system, including: the graphic block data writing device 71 provided by any of the above-mentioned eighth embodiment and/or the above-mentioned ninth embodiment. A graphic block data reading device 72 provided by a content.
本实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行以实现如上述实施例一至实施例三任一内容所提供的写入方法和/或如上述实施例四至实施例六任一内容所提供的读取方法。This embodiment also provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to implement the writing method provided by any of the above-mentioned Embodiments 1 to 3 and/or such as The reading method provided by any of the foregoing Embodiments 4 to 6.
本实施例提供的系统和存储介质具有与上述方法相同的技术效果。The system and storage medium provided in this embodiment have the same technical effects as the above method.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处 理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
在本申请的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In the description of the present application, it should be understood that the terms "first" and "second" are only used for description purposes, and cannot be interpreted as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature. In the description of the present application, "plurality" means at least two, such as two, three, etc., unless expressly and specifically defined otherwise.
在本申请中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”、“固定”等术语应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或成一体;可以是机械连接,也可以是电连接或可以互相通讯;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通或两个元件的相互作用关系。对于本领域的普通技术人员而言,可以根据具体情况理解上述术语在本申请中的具体含义。In this application, unless otherwise expressly specified and limited, the terms "installed", "connected", "connected", "fixed" and other terms should be understood in a broad sense, for example, it may be a fixed connection or a detachable connection It can be a mechanical connection, an electrical connection or can communicate with each other; it can be directly connected, or it can be indirectly connected through an intermediate medium, it can be the internal communication between two elements or the interaction relationship between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific situations.
尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。While the preferred embodiments of the present application have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of this application.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (18)

  1. 一种图形分块数据写入方法,其特征在于,包括:A method for writing graphics block data, comprising:
    获取待写入图形分块数据中的各图元数据,所述图元数据包括图元支持的所有属性的属性数据;Acquiring each graphic element data to be written in the graphic block data, the graphic element data includes attribute data of all attributes supported by the graphic element;
    根据所述图元数据生成与图元一一对应的第一数据组,所述第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;A first data group corresponding to the primitives one-to-one is generated according to the primitive data, and each element in the first data group is used to indicate whether the primitive contains an attribute; when the primitive contains an attribute, the attribute is a valid attribute;
    根据所述图元数据生成与图元一一对应的第二数据组,所述第二数据组中的每一个元素为所述第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;所述有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致;Generate a second data group corresponding to the primitives one-to-one according to the primitive data, each element in the second data group is valid attribute data corresponding to the valid attributes in the first data group, and each valid attribute data Continuous storage; the order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group;
    根据第一数据组和第二数据组中的数据生成图元数据包,并将图元数据包写入存储器;所述第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据。Generate a primitive data packet according to the data in the first data group and the second data group, and write the primitive data packet into the memory; the data in the first data group is used as the header of the primitive data packet, and the second data group The data in as package data in the metadata package.
  2. 根据权利要求1所述的方法,其特征在于,根据所述图元数据生成与图元一一对应的第一数据组,包括:The method according to claim 1, wherein generating a first data group corresponding to the primitives one-to-one according to the primitive data comprises:
    配置与图元一一对应的第一寄存器,第一寄存器的位数与图元所支持的属性数目相同;Configure the first register corresponding to the primitive one-to-one, and the number of bits of the first register is the same as the number of attributes supported by the primitive;
    根据所述图元数据向第一寄存器写入数据,第一寄存器中的每一位作为一个元素,第一寄存器的所有位组成第一数据组。Write data into the first register according to the primitive data, each bit in the first register is used as an element, and all the bits in the first register form a first data group.
  3. 根据权利要求2所述的方法,其特征在于,根据所述图元数据生成与图元一一对应的第二数据组,包括:The method according to claim 2, wherein generating a second data group corresponding to the primitives one-to-one according to the primitive data, comprising:
    配置与图元一一对应的第二寄存器;Configure the second register corresponding to the primitive one-to-one;
    根据所述图元数据向第二寄存器写入数据,第二寄存器中的每个预设长度数据作为一个元素,第二寄存器的所有元素组成第二数据组。Data is written into the second register according to the primitive data, each preset length data in the second register is used as an element, and all elements of the second register form a second data group.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,将图元数据包写 入存储器之后,还包括:The method according to any one of claims 1-3, characterized in that, after the primitive data packet is written into the memory, it also includes:
    将图元数据包在存储器中的存储地址写入随机存取存储器RAM中的预设存储区域内,并替换所述预设存储区域内的原数据;一个图形分块数据中的各图元的图元数据包对应的存储地址写入同一个预设存储区域。Write the storage address of the primitive data packet in the memory into the preset storage area in the random access memory RAM, and replace the original data in the preset storage area; The storage address corresponding to the primitive data package is written into the same preset storage area.
  5. 一种图形分块数据读取方法,其特征在于,包括:A method for reading graphic block data, comprising:
    从存储器读出图元数据包,并解析得到包头和包数据;Read the primitive data packet from the memory, and parse to obtain the packet header and packet data;
    根据所述包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;A third data group is generated according to the packet header, and each element in the third data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is a valid attribute;
    根据所述包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据;Generate a fourth data group according to the package data, and each element in the fourth data group is an effective attribute data;
    按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取一个元素的数据作为与有效属性对应的有效属性数据。According to the arrangement order of the valid attributes in the third data group, the data of one element is sequentially read from the fourth data group as the valid attribute data corresponding to the valid attributes.
  6. 根据权利要求5所述的方法,其特征在于,根据所述包头生成第三数据组,包括:The method according to claim 5, wherein generating a third data group according to the packet header comprises:
    配置与图元一一对应的第三寄存器,第三寄存器的位数与图元所支持的属性数目相同;Configure the third register corresponding to the primitive one-to-one, and the number of bits of the third register is the same as the number of attributes supported by the primitive;
    将包头写入第三寄存器,所述第三寄存器中的每一位作为一个元素,第三寄存器的所有位组成第三数据组。The packet header is written into the third register, each bit in the third register is used as an element, and all the bits in the third register form a third data group.
  7. 根据权利要求6所述的方法,其特征在于,根据所述包数据生成第四数据组,包括:The method according to claim 6, wherein generating a fourth data group according to the packet data comprises:
    配置与图元一一对应的第四寄存器;Configure the fourth register corresponding to the primitive one-to-one;
    将包数据写入第四寄存器,第四寄存器中每个预设长度的数据作为一个元素。The packet data is written into the fourth register, and each preset length of data in the fourth register is taken as an element.
  8. 根据权利要求5-7任一项所述的方法,其特征在于,在从存储器读出图元数据包之前,还包括:The method according to any one of claims 5-7, characterized in that, before reading the primitive data packet from the memory, the method further comprises:
    从随机存取存储器RAM的预设存储区域内读取当前地址数据;Read the current address data from the preset storage area of the random access memory RAM;
    判断当前地址数据是否与预设存储区域内初始分配的地址不同,若不同,则从存储器读出图元数据包。It is judged whether the current address data is different from the address initially allocated in the preset storage area, and if it is different, the primitive data packet is read from the memory.
  9. 一种图形分块数据写入装置,其特征在于,包括:A device for writing graphics block data, comprising:
    图元数据获取模块,用于获取待写入图形分块数据中的各图元数据,所述图元数据包括图元支持的所有属性的属性数据;The graphic metadata acquisition module is used to acquire each graphic metadata to be written in the graphic block data, where the graphic metadata includes attribute data of all attributes supported by the graphic element;
    第一数据组生成模块,用于根据所述图元数据生成与图元一一对应的第一数据组,所述第一数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;The first data group generation module is used to generate a first data group corresponding to the primitives one-to-one according to the primitive data, and each element in the first data group is used to indicate whether the primitive contains an attribute; when When a primitive contains an attribute, the attribute is a valid attribute;
    第二数据组生成模块,用于根据所述图元数据生成与图元一一对应的第二数据组,所述第二数据组中的每一个元素为所述第一数据组中有效属性对应的有效属性数据,各有效属性数据连续存储;所述有效属性数据在第二数据组中排列的顺序与对应有效属性在第一数据组中排列的顺序一致;A second data group generating module, configured to generate a second data group corresponding to the primitives one-to-one according to the primitive data, and each element in the second data group corresponds to a valid attribute in the first data group The valid attribute data of , each valid attribute data is stored continuously; the order in which the valid attribute data is arranged in the second data group is consistent with the order in which the corresponding valid attributes are arranged in the first data group;
    图元数据包生成模块,用于根据第一数据组和第二数据组中的数据生成图元数据包;所述第一数据组中的数据作为图元数据包的包头,第二数据组中的数据作为图元数据包中的包数据;The graphic element data packet generating module is used to generate the graphic element data packet according to the data in the first data group and the second data group; the data in the first data group is used as the header of the graphic element data packet, and the data in the second data group The data is used as the package data in the metadata package;
    图元数据包写入模块,用于将图元数据包写入存储器。The primitive data packet writing module is used to write the primitive data packet into the memory.
  10. 根据权利要求9所述的装置,其特征在于,第一数据组生成模块,包括:The device according to claim 9, wherein the first data group generation module comprises:
    第一寄存器配置单元,用于配置与图元一一对应的第一寄存器,第一寄存器的位数与图元所支持的属性数目相同;The first register configuration unit is used to configure the first register corresponding to the primitives one-to-one, and the number of bits of the first register is the same as the number of attributes supported by the primitives;
    第一寄存器写入单元,用于根据所述图元数据向第一寄存器写入数据,第一寄存器中的每一位作为一个元素,第一寄存器的所有位组成第一数据组。The first register writing unit is configured to write data to the first register according to the primitive data, each bit in the first register is used as an element, and all bits of the first register form a first data group.
  11. 根据权利要求10所述的装置,其特征在于,第二数据组生成模块,包括:The device according to claim 10, wherein the second data group generating module comprises:
    第二寄存器配置单元,用于配置与图元一一对应的第二寄存器;The second register configuration unit is used to configure the second register corresponding to the primitives one-to-one;
    第二寄存器配置单元,用于根据所述图元数据向第二寄存器写入数据,第 二寄存器中的每个预设长度数据作为一个元素,第二寄存器的所有元素组成第二数据组。The second register configuration unit is configured to write data into the second register according to the primitive data, each preset length data in the second register is used as an element, and all elements of the second register form a second data group.
  12. 根据权利要求9-11任一项所述的装置,其特征在于,还包括:The device according to any one of claims 9-11, further comprising:
    地址写入模块,用于将图元数据包在存储器中的存储地址写入随机存取存储器RAM中的预设存储区域内,并替换所述预设存储区域内的原数据;一个图形分块数据中的各图元的图元数据包对应的存储地址写入同一个预设存储区域。The address writing module is used to write the storage address of the primitive data packet in the memory into the preset storage area in the random access memory RAM, and replace the original data in the preset storage area; a graphics block The storage addresses corresponding to the primitive data packets of each primitive in the data are written into the same preset storage area.
  13. 一种图像分块数据读取装置,其特征在于,包括:An image block data reading device, characterized in that it includes:
    图元数据包读出模块,用于从存储器读出图元数据包,并解析得到包头和包数据;The primitive data packet reading module is used to read out the primitive data packet from the memory, and parse to obtain the packet header and packet data;
    第三数据组生成模块,用于根据所述包头生成第三数据组,第三数据组中的每一个元素用于表示图元是否含有一个属性;当图元含有一个属性时,所述属性为有效属性;The third data group generating module is configured to generate a third data group according to the packet header, and each element in the third data group is used to indicate whether the graphic element contains an attribute; when the graphic element contains an attribute, the attribute is valid attributes;
    第四数据组生成模块,用于根据所述包数据生成第四数据组,第四数据组中的每一个元素为一个有效属性数据;The fourth data group generation module is used to generate a fourth data group according to the packet data, and each element in the fourth data group is an effective attribute data;
    有效属性数据读取模块,用于按照第三数据组中有效属性的排列顺序,依次从第四数据组中读取预设长度的数据作为与有效属性对应的有效属性数据。The valid attribute data reading module is configured to sequentially read data of a preset length from the fourth data group as valid attribute data corresponding to the valid attributes according to the arrangement sequence of the valid attributes in the third data group.
  14. 根据权利要求13所述的装置,其特征在于,第三数据组生成模块,包括:The device according to claim 13, wherein the third data group generation module comprises:
    第三寄存器配置单元,用于配置与图元一一对应的第三寄存器,第三寄存器的位数与图元所支持的属性数目相同;The third register configuration unit is used to configure the third register corresponding to the primitive one-to-one, and the number of bits of the third register is the same as the number of attributes supported by the primitive;
    第三寄存器写入单元,用于将包头写入第三寄存器,所述第三寄存器中的每一位作为一个元素,第一寄存器的所有位组成第三数据组。The third register writing unit is used for writing the packet header into the third register, each bit in the third register is used as an element, and all the bits in the first register form a third data group.
  15. 根据权利要求14所述的装置,其特征在于,第四数据组生成模块包括:The device according to claim 14, wherein the fourth data group generating module comprises:
    第四寄存器配置单元,用于配置与图元一一对应的第四寄存器;a fourth register configuration unit, configured to configure a fourth register corresponding to the primitives one-to-one;
    第四寄存器写入单元,用于将包数据写入第四寄存器,第四寄存器中没有预设长度的数据作为一个元素。The fourth register writing unit is used for writing the packet data into the fourth register, and the data without preset length in the fourth register is used as one element.
  16. 根据权利要求13-15任一项所述的装置,其特征在于,还包括:The device according to any one of claims 13-15, further comprising:
    地址数据读取模块,用于从随机存取存储器RAM的预设存储区域内读取当前地址数据;The address data reading module is used to read the current address data from the preset storage area of the random access memory RAM;
    地址判断模块,用于判断当前地址数据是否与预设存储区域内初始分配的地址不同,若不同,则触发图元数据包读出模块的操作。The address judgment module is used for judging whether the current address data is different from the initially allocated address in the preset storage area, and if it is different, the operation of the primitive data packet reading module is triggered.
  17. 一种图形分块数据读写系统,其特征在于,包括:如权利要求9-12任一项所述的图形分块数据写入装置和/或如权利要求13-16任一项所述的图形分块数据读取装置。A graphic block data reading and writing system, characterized in that it comprises: a graphic block data writing device as described in any one of claims 9-12 and/or a graphic block data writing device as described in any one of claims 13-16 Graphic block data reading device.
  18. 一种计算机可读存储介质,其特征在于,其上存储有计算机程序;所述计算机程序被处理器执行以实现如权利要求1-4任一项所述的写入方法和/或如权利要求5-8任一项所述的读取方法。A computer-readable storage medium, characterized in that a computer program is stored thereon; the computer program is executed by a processor to implement the writing method as claimed in any one of claims 1-4 and/or as claimed in claims The reading method of any one of 5-8.
PCT/CN2020/118636 2020-07-10 2020-09-29 Tiled graphic data read/write method and apparatus, and device, and storage medium WO2022007207A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010662730.3 2020-07-10
CN202010662730.3A CN111882482B (en) 2020-07-10 Method, device, equipment and storage medium for reading and writing graphic block data

Publications (1)

Publication Number Publication Date
WO2022007207A1 true WO2022007207A1 (en) 2022-01-13

Family

ID=73150983

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/118636 WO2022007207A1 (en) 2020-07-10 2020-09-29 Tiled graphic data read/write method and apparatus, and device, and storage medium

Country Status (1)

Country Link
WO (1) WO2022007207A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070002066A1 (en) * 2005-06-29 2007-01-04 Microsoft Corporation Procedural graphics architectures and techniques
CN102279734A (en) * 2010-06-12 2011-12-14 环旭电子股份有限公司 Automatic data mapping embedded system and method thereof
CN103412962A (en) * 2013-09-04 2013-11-27 国家测绘地理信息局卫星测绘应用中心 Storage method and reading method for mass tile data
CN109245773A (en) * 2018-10-30 2019-01-18 南京大学 A kind of decoding method based on block circulation sparse matrix neural network
CN109416702A (en) * 2016-04-12 2019-03-01 黄锡霖 Method, system and the program product of sparse matrix compression based on mask

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070002066A1 (en) * 2005-06-29 2007-01-04 Microsoft Corporation Procedural graphics architectures and techniques
CN102279734A (en) * 2010-06-12 2011-12-14 环旭电子股份有限公司 Automatic data mapping embedded system and method thereof
CN103412962A (en) * 2013-09-04 2013-11-27 国家测绘地理信息局卫星测绘应用中心 Storage method and reading method for mass tile data
CN109416702A (en) * 2016-04-12 2019-03-01 黄锡霖 Method, system and the program product of sparse matrix compression based on mask
CN109245773A (en) * 2018-10-30 2019-01-18 南京大学 A kind of decoding method based on block circulation sparse matrix neural network

Also Published As

Publication number Publication date
CN111882482A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
US20210312668A1 (en) Real time on-chip texture decompression using shader processors
US6989838B2 (en) Methods, systems, and data structures for generating a rasterizer
US7379067B2 (en) Scalable high performance 3D graphics
WO2016011886A1 (en) Method and apparatus for decoding image
CN111913659B (en) Block data processing method, device and system and storage medium
US10991146B2 (en) Residency map descriptors
JP2020519042A (en) Apply delta color compression to video
WO2022007207A1 (en) Tiled graphic data read/write method and apparatus, and device, and storage medium
CN111882482B (en) Method, device, equipment and storage medium for reading and writing graphic block data
US6747653B2 (en) Efficient object storage for zone rendering
US8041903B2 (en) Processor and method for controlling memory
US9437025B2 (en) Stencil data compression system and method and graphics processing unit incorporating the same
WO2023060833A1 (en) Data exchange method, electronic device and storage medium
CN115861511B (en) Method, device, system and computer equipment for processing drawing command
US8780128B2 (en) Contiguously packed data
CN111913657A (en) Block data read-write method, device, system and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20944399

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.06.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20944399

Country of ref document: EP

Kind code of ref document: A1