IP Library Granted Patent US 12694464
Granted Patent B2
US 12694464 · App. 18/308,969 · Granted Jul 28, 2026

Data processing method and related apparatus

Inventors: Jing Ren (Shenzhen, CN); Deyou Kong (Nanjing, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06T1/20G06F9/5027
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12694464
App. No.
18/308,969
Granted
Jul 28, 2026
Kind
B2
Abstract

A data processing method includes a graphics processing unit (GPU) obtaining rendering data that is sent by a central processing unit (CPU) and that includes a plurality of pieces of attribute data. The GPU stores the plurality of pieces of attribute data into continuous storage space, for example, stores the plurality of pieces of attribute data into the continuous storage space in a form of an array. Then, the GPU directly determines an address of target attribute data in the continuous storage space based on an attribute selector to obtain the target attribute data.

Claims (61)

1 . A data processing method implemented by a graphics processing unit (GPU), wherein the data processing method comprises:

obtaining, from a central processing unit (CPU), rendering data, wherein the rendering data comprises first pieces of first attribute data, second pieces of second attribute data, and third pieces of third attribute data, wherein all of the first pieces of first attribute data have position attribute data, wherein all of the second pieces of second attribute data have normal attribute data, and wherein all of the third pieces of third attribute data have UV attribute data;

rearranging the rendering data to obtain a first group of attribute data comprising the first pieces of first attribute data, a second group of attribute data comprising the second pieces of second attribute data, and a third group of attribute data comprising the third pieces of third attribute data;

obtaining, from the CPU, indication information comprising mapping relationships identifying the position attribute data and a first location associated with the position attribute data, the normal attribute data and a second location associated with the normal attribute data, and the UV attribute data and a third location associated with the UV attribute data;

separately storing, based on the mapping relationships, the first group of attribute data to a first address space of a continuous storage space, the second group of attribute data to a second address space of the continuous storage space, and the third group of attribute data to a third address space of the continuous storage space by:

storing the first group of attribute data having the position attribute data to the first location in the first address space and marking a first indication of the position attribute data stored in the first address space;

storing the second group of attribute data having the normal attribute data to the second location in the second address space and marking a second indication of the normal attribute data stored in the second address space; and

storing the third group of attribute data having the UV attribute data to the third location in the third address space and marking a third indication of the UV attribute data stored in the third address space;

obtaining an attribute selector corresponding to a to-be-rendered material, wherein the attribute selector is for selecting one of the first group of attribute data, the second group of attribute data, or the third group of attribute data as target attribute data for rendering the to-be-rendered material;

obtaining, based on the attribute selector, an address of the target attribute data in the continuous storage space; and

obtaining, based on the address, the target attribute data from the continuous storage space.

2 . The data processing method of claim 1 , further comprising arranging, based on a storage sequence, the first group of attribute data, the second group of attribute data, and the third group of attribute data into the continuous storage space.

3 . The data processing method of claim 2 , further comprising:

obtaining, based on the indication information, storage locations of the first group of attribute data, the second group of attribute data, and the third group of attribute data; and

arranging, based on a sequence of the storage locations, the first group of attribute data, the second group of attribute data, and the third group of attribute data into the continuous storage space.

4 . The data processing method of claim 3 , wherein one of the storage locations is for storing one of the first group of attribute data, the second group of attribute data, or the third group of attribute data having a same attribute type.

5 . The data processing method of claim 1 , wherein obtaining the address comprises obtaining, based on the attribute selector and a first data length of the target attribute data, the address.

6 . The data processing method of claim 5 , further comprising obtaining a first starting address of the continuous storage space, and wherein obtaining the address comprises:

obtaining, based on the first starting address and a product of the attribute selector and the first data length, a second starting address of the target attribute data; and

obtaining, based on the second starting address and the first data length, an end address of the target attribute data.

7 . The data processing method of claim 1 , wherein the rendering data are based on the to-be-rendered material.

8 . The data processing method of claim 1 , wherein the rendering data further comprise texture coordinate attribute data or tangent attribute data.

9 . The data processing method of claim 1 , wherein the UV attribute data in the rendering data is from at least two different locations, and wherein after rearranging the rendering data, the UV attribute data from the at least two different locations are stored to the same third address space of the continuous storage space.

10 . The data processing method of claim 1 , wherein the indication information is obtained from the CPU separately from the rendering data.

11 . The data processing method of claim 10 , wherein the indication information comprises a table identifying each location and corresponding attribute data stored at each location.

12 . An electronic device, comprising:

a central processing unit (CPU); and

a graphics processing unit (GPU) coupled to the CPU and configured to:

obtain, from the CPU, rendering data, wherein the rendering data comprises first pieces of first attribute data, second pieces of second attribute data, and third pieces of third attribute data, wherein all of the first pieces of first attribute data have position attribute data, wherein all of the second pieces of second attribute data have normal attribute data, and wherein all of the third pieces of UV attribute data;

rearrange the rendering data to obtain a first group of attribute data comprising the first pieces of first attribute data, a second group of attribute data comprising the second pieces of second attribute data, and a third group of attribute data comprising the third pieces of third attribute data;

obtain, from the CPU, indication information comprising mapping relationships identifying the position attribute data and a first location associated with the position attribute data, the normal attribute data and a second location associated with the normal attribute data, and the UV attribute data and a third location associated with the UV attribute data;

separately store, based on the mapping relationships, the first group of attribute data to a first address space of a continuous storage space, the second group of attribute data to a second address space of the continuous storage space, and the third group of attribute data to a third address space of the continuous storage space by:

storing the first group of attribute data having the position attribute data to the first location in the first address space and marking a first indication of the position attribute data stored in the first address space;

storing the second group of attribute data having the normal attribute data to the second location in the second address space and marking a second indication of the normal attribute data stored in the second address space; and

storing the third group of attribute data having the UV attribute data to the third location in the third address space and marking a third indication of the UV attribute data stored in the third address space;

obtain an attribute selector corresponding to a to-be-rendered material, wherein the attribute selector is for selecting one of the first group of attribute data, the second group of attribute data, or the third group of attribute data as target attribute data for rendering the to-be-rendered material;

obtain, based on the attribute selector, an address of the target attribute data in the continuous storage space; and

obtain, based on the address, the target attribute data from the continuous storage space.

13 . The electronic device of claim 12 , wherein the GPU is further configured to arrange, based on a storage sequence, the first group of attribute data, the second group of attribute data, and the third group of attribute data into the continuous storage space.

14 . The electronic device of claim 13 , wherein the GPU is further configured to:

obtain, based on the indication information, storage locations of the first group of attribute data, the second group of attribute data, and the third group of attribute data; and

arrange, based on a sequence of the storage locations, the first group of attribute data, the second group of attribute data, and the third group of attribute data into the continuous storage space.

15 . The electronic device of claim 14 , wherein one of the storage locations is for storing one of the first group of attribute data, the second group of attribute data, or the third group of attribute data having a same attribute type.

16 . The electronic device of claim 12 , wherein the GPU is further configured to obtain, based on the attribute selector and a first data length of the target attribute data, the address.

17 . The electronic device of claim 16 , wherein the GPU is further configured to:

obtain a first starting address of the continuous storage space;

obtain, based on the first starting address and a product of the attribute selector and the first data length, a second starting address of the target attribute data; and

obtain, based on the second starting address and the first data length, an end address of the target attribute data.

18 . The electronic device of claim 12 , wherein the CPU is further configured to obtain, based on the to-be-rendered material, the rendering data.

19 . The electronic device of claim 12 , wherein the rendering data further comprise joint attribute data or weight attribute data.

20 . A computer program product comprising instructions stored on a non-transitory computer-readable medium that, when execute by one or more processors, cause a graphics processing unit (GPU) to:

obtain, from a central processing unit (CPU), rendering data, wherein the rendering data comprises first pieces of first attribute data, second pieces of second attribute data, and third pieces of third attribute data, wherein all of the first pieces of first attribute data have position attribute data, wherein all of the second pieces of second attribute data have normal attribute data, and wherein all of the third pieces of third attribute data have UV attribute data;

rearrange the rendering data to obtain a first group of attribute data comprising the first pieces of first attribute data, a second group of attribute data comprising the second pieces of second attribute data, and a third group of attribute data comprising the third pieces of third attribute data;

obtain, from the CPU, indication information comprising mapping relationships identifying the position attribute data and a first location associated with the position attribute data, the normal attribute data and a second location associated with the normal attribute data, and the UV attribute data and a third location associated with the UV attribute data;

separately store, based on the mapping relationships, the first group of attribute data to a first address space of a continuous storage space, the second group of attribute data to a second address space of the continuous storage space, and the third group of attribute data to a third address space of the continuous storage space by:

storing the first group of attribute data having the position attribute data to the first location in the first address space and marking a first indication of the position attribute data stored in the first address space;

storing the second group of attribute data having the normal attribute data to the second location in the second address space and marking a second indication of the normal attribute data stored in the second address space; and

storing the third group of attribute data having the UV attribute data to the third location in the third address space and marking a third indication of the UV attribute data stored in the third address space;

obtain an attribute selector corresponding to a to-be-rendered material, wherein the attribute selector is for selecting one of the first group of attribute data, the second group of attribute data, or the third group of attribute data as target attribute data for rendering the to-be-rendered material;

obtain, based on the attribute selector, an address of the target attribute data in the continuous storage space; and

obtain, based on the address, the target attribute data from the continuous storage space.