Texture data processing methods, apparatus, equipment, media and program products

CN121329753BActive Publication Date: 2026-08-14MOORE THREADS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]然而,相关技术中的建模方法工作量巨大且繁琐,导致对GPU的开发效率较低

Benefits of technology

[0019]本申请实施例提供的技术方案带来的有益效果至少包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121329753B_ABST
    Figure CN121329753B_ABST
Patent Text Reader

Abstract

This application discloses a texture data processing method, apparatus, device, medium, and program product, relating to the field of graphics processors. The method includes: acquiring indication information and texture data in a first data format; splitting the texture data based on channel splitting rules corresponding to the first data format to obtain first texture components corresponding to at least two channels; performing format conversion processing on the first texture components corresponding to the at least two channels according to a preset second data format to obtain second texture components corresponding to the at least two channels; and processing the second texture components corresponding to the at least two channels based on the processing method indicated by the indication information to obtain a texture processing result. Since there is no need to consider the format differences of the texture data when processing it, different processing flows are avoided for different formats of texture data, thereby improving the development efficiency of GPUs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of graphics processing, and in particular to a texture data processing method, apparatus, device, medium, and program product. Background Technology

[0002] In the early stages of GPU (Graphics Processing Unit) development, it is necessary to abstract the GPU's processing flow through software modeling in order to test the GPU's functionality. Among these, the GPU Pipeline is the core of GPU modeling, and the processing of texture data is a crucial step in the GPU Pipeline.

[0003] In related technologies, hardware-based electronic system-level modeling methods are typically used to model the various stages of a GPU pipeline. Taking the texture mapping stage as an example, hardware-based electronic system-level modeling methods need to define the hardware design details (such as registers, signals, etc.) and data flow of the texture mapping stage in order to achieve accurate modeling of the texture mapping stage.

[0004] However, the modeling methods in related technologies are extremely labor-intensive and cumbersome, resulting in low development efficiency for GPUs. Summary of the Invention

[0005] This application provides a texture data processing method, apparatus, device, medium, and program product, the technical solution of which is as follows:

[0006] On the one hand, a texture data processing method is provided, the method comprising:

[0007] Acquire instruction information and texture data in a first data format, wherein the instruction information is used to characterize the processing method of the texture data in the graphics processing pipeline;

[0008] The texture data is split according to the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel;

[0009] According to a preset second data format, the first texture components corresponding to the at least two channels are subjected to format conversion processing to obtain the second texture components corresponding to the at least two channels, wherein the second texture components are data in the second data format;

[0010] Based on the processing method indicated by the instruction information, the second texture components corresponding to the at least two channels are processed to obtain the texture processing result.

[0011] On the other hand, a texture data processing apparatus is provided, the apparatus comprising:

[0012] A data processing unit is used to acquire indication information and texture data in a first data format, wherein the indication information is used to characterize the processing method of the texture data in the graphics processing pipeline;

[0013] The data splitting unit is used to split the texture data based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel.

[0014] The format conversion unit is used to perform format conversion processing on the first texture components corresponding to the at least two channels according to a preset second data format to obtain the second texture components corresponding to the at least two channels, wherein the second texture components are data in the second data format.

[0015] The data processing unit is further configured to process the second texture components corresponding to the at least two channels respectively based on the processing method indicated by the indication information, and obtain the texture processing result.

[0016] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement any of the texture data processing methods described above.

[0017] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction, at least one program, code set, or instruction set is stored therein, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement any of the texture data processing methods described above.

[0018] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the texture data processing methods described above.

[0019] The beneficial effects of the technical solutions provided in this application include at least the following:

[0020] A texture data processing method is provided. After acquiring texture data, the method converts texture data of any format (such as the first data format) into texture data of a unified format (i.e., the second data format) by means of channel splitting rules and a preset second data format. Then, the texture data of the unified format is processed according to the instruction information to obtain the texture processing result. Since there is no need to pay attention to the format difference of texture data when processing texture data, it avoids designing different processing flows for texture data of different formats, thereby improving the development efficiency of GPU.

[0021] A texture data processing device is provided, including a data processing unit, a data splitting unit, and a format conversion unit. By designing the data splitting unit and the format conversion unit, texture data in any format (such as a first data format) is converted into texture data in a unified format (i.e., a second data format). This reduces the dependence of the data processing unit on the data format of the texture data. In other words, developers do not need to design different data processing units for different data formats, reducing code redundancy during modeling. Furthermore, the data splitting unit splits the texture data into at least two texture components through channel splitting rules. After splitting, the data conversion logic complexity of the data conversion unit is reduced, thus reducing the design complexity of the data processing unit. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of a computer system provided in an exemplary embodiment of this application;

[0024] Figure 2 This is a schematic diagram of a software simulation platform provided in an exemplary embodiment of this application;

[0025] Figure 3 This is a flowchart of a texture data processing method provided in an exemplary embodiment of this application;

[0026] Figure 4 This is a schematic diagram of a module in the texture mapping stage of a graphics processing pipeline provided in an exemplary embodiment of this application;

[0027] Figure 5 This is a flowchart of a texture data processing method provided in another exemplary embodiment of this application;

[0028] Figure 6This is a schematic diagram of a texture data processing method provided in an exemplary embodiment of this application;

[0029] Figure 7 This is a flowchart of a texture data processing method provided in yet another exemplary embodiment of this application;

[0030] Figure 8 This is a schematic diagram of a texture data processing method provided in another exemplary embodiment of this application;

[0031] Figure 9 This is a structural block diagram of a texture data processing apparatus provided in an exemplary embodiment of this application;

[0032] Figure 10 This is a structural block diagram of a texture data processing apparatus provided in another exemplary embodiment of this application;

[0033] Figure 11 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0035] In this application, the terms "first" and "second" are used to distinguish between identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first" and "second", nor is there any limitation on the quantity or execution order.

[0036] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user individually or by all parties in full, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0037] In the early stages of GPU development, software modeling is needed to abstract the GPU's processing flow to test its functionality. The GPU Pipeline is the core of GPU modeling, and texture data processing is a crucial step within it. Related technologies typically employ hardware-based electronic system-level modeling methods to model each stage of the GPU Pipeline. Taking the texture mapping stage as an example, this method requires defining the hardware design details (such as registers, signals, etc.) and data flow for accurate modeling of this stage. However, these modeling methods are extremely labor-intensive and cumbersome, resulting in low development efficiency for GPUs.

[0038] Based on this, this application provides a texture data processing method and a texture data processing apparatus, which can be applied to GPU modeling processing during the GPU development stage.

[0039] On the one hand, a texture data processing method is provided. After acquiring texture data, texture data of any format (such as the first data format) is converted into texture data of a unified format (i.e., the second data format) by means of channel splitting rules and a preset second data format. Then, the texture data of the unified format is processed according to the instruction information to obtain the texture processing result. Since there is no need to pay attention to the format difference of texture data when processing texture data, different processing flows are avoided for texture data of different formats, thereby improving the development efficiency of GPU.

[0040] On the other hand, a texture data processing device is provided, including a data processing unit, a data splitting unit, and a format conversion unit. By designing the data splitting unit and the format conversion unit, texture data in any format (such as a first data format) is converted into texture data in a unified format (i.e., a second data format), reducing the dependence of the data processing unit on the data format of the texture data. In other words, developers do not need to design different data processing units for different data formats, reducing code redundancy during modeling. Furthermore, the data splitting unit splits the texture data into at least two texture components through channel splitting rules. After splitting, the data conversion logic complexity of the data conversion unit is reduced, thus reducing the design complexity of the data processing unit.

[0041] The following section first introduces the computer system used to implement texture data processing methods.

[0042] Figure 1 A structural block diagram of a computer system 100 provided in an exemplary embodiment of this application is shown. The computer system 100 can implement a system architecture for a texture data processing method. The computer system 100 includes a terminal 110 and a server 120. The terminal 110 is connected to the server 120 via a wireless network or a wired network.

[0043] In some embodiments, terminal 110 may be a smartphone, tablet, laptop, desktop computer, smart home appliance, smart vehicle terminal, etc., but is not limited to these. Optionally, terminal 110 may have a software simulation platform deployed thereon. This software simulation platform is a virtualized GPU development and testing environment through which developers can simulate the complete GPU workflow at the software level. Please refer to [reference needed]. Figure 2 , Figure 2 A schematic diagram of a software simulation platform is shown, such as... Figure 2 As shown, the software simulation platform 200 includes the following components:

[0044] Host environment 210: Provides the main development environment for developers, supporting the running of applications on native operating systems (such as Linux / Windows); developers write and debug graphics rendering programs through the host environment 210, from which all commands are initiated. The host environment 210 includes driver 211, which acts as a bridge between the host environment 210 and the virtual hardware device 220, responsible for command forwarding and data interaction.

[0045] Virtual hardware device 220 (i.e., the virtual machine described above): uses the virtual machine software QEMU (QuickEmulator) to simulate the operation of the GPU. Virtual hardware device 220 encapsulates the following:

[0046] ESL (Electronic System Level) based firmware 221: GPU firmware based on ESL design, responsible for instruction decoding, resource allocation and low-level hardware control.

[0047] An ESL-based GPU Pipeline222: This is a GPU pipeline designed based on ESL, which includes a vertex processing stage, a primitive assembly stage, a rasterization stage, a texture mapping stage, a pixel shading stage, and an output stage. The vertex processing stage receives raw vertex data and performs operations such as model-view transformation and projection transformation. The primitive assembly stage combines the vertex data output from the vertex processing stage into geometric primitives according to rules (such as triangles and line segments). The rasterization stage converts geometric primitives into pixel fragments and determines the position and coverage of each pixel fragment. The texture mapping stage applies texture information to pixel fragments, including texture decoding and texture filtering. The pixel shading stage determines the final color of each pixel fragment. The output stage performs depth testing (Z-Test) and stencil testing.

[0048] This application mainly relates to the processing of texture data in the ESL-based graphics processing pipeline 222, such as the texture mapping stage, which includes at least one of a texture decoding module and a texture filtering module. The texture decoding module retrieves a texture image from memory and decodes it. The texture filtering module samples at least two texture information items from the texture image based on the target texture coordinates corresponding to each pixel fragment, and then interpolates these two texture information items to obtain the texture information applied to the pixel fragment.

[0049] Memory Management Unit (MMU) 223: Manages the mapping between virtual memory and physical memory, stores data, and ensures efficient memory access in the rendering process.

[0050] In illustrative terms, the operation flow of the software simulation platform 200 provided in this application is as follows: The developer initiates instructions through the host environment 210 (instructions used to verify the work of each stage of the graphics processing pipeline, such as instructions used to verify the texture processing module 2221); the driver 211 converts the instructions into virtual machine protocols and sends them to the ESL-based firmware 221; after parsing the instructions, the ESL-based firmware 221 allocates computing resources (such as video memory and threads); the ESL-based graphics processing pipeline 222 reads data from the memory management unit 223 and executes the corresponding processing tasks according to the instructions, finally obtaining the task processing results.

[0051] In some embodiments, server 120 provides backend services for the software simulation platform installed in the terminal. It is worth noting that server 120 can be a standalone physical server, a server cluster or distributed system consisting of at least two physical servers, a cloud server providing basic cloud computing services, or a node in a blockchain system.

[0052] Optionally, server 120 undertakes the main computing work and terminal 110 undertakes the secondary computing work; or, server 120 undertakes the secondary computing work and terminal 110 undertakes the main computing work; or, server 120 and terminal 110 adopt a distributed computing architecture for collaborative computing.

[0053] The texture data processing method provided in this application can be executed by a computer device, which refers to an electronic device capable of data calculation, processing, and storage. Figure 1 Taking the computer system shown as an example, the texture data processing method can be executed by the terminal 110 (for example, the texture data processing method is executed by the software simulation platform deployed in the terminal 110), or it can be executed by the interaction between the terminal 110 and the server 120. This application does not limit this.

[0054] The specific process of the texture data processing method provided in this application will be described below.

[0055] Based on the above introduction, Figure 3 This is a flowchart of a texture data processing method provided in an embodiment of this application, which is executed by terminal 110. The method includes the following steps 310 to 340.

[0056] Step 310: Obtain the instruction information and texture data in the first data format.

[0057] Texture data is data used to describe the appearance features of an object's surface. Texture data includes, but is not limited to, at least one of the following texture information: color information, transparency information, normal direction information, depth information, and roughness information. It should be noted that the examples of texture data above are merely illustrative and are not intended to limit the scope of the application. Optionally, the types of texture data include, but are not limited to, at least one of two-dimensional texture data and three-dimensional texture data. Texture data is typically stored in the form of a texture image (two-dimensional bitmap or three-dimensional array), where each pixel (or voxel) stores texture data. Illustratively, two-dimensional texture data can be stored in the form of a two-dimensional bitmap, where each pixel contains color information (such as RGB values) and transparency information (Alpha value); three-dimensional texture data is stored in the form of a three-dimensional array, where each voxel stores information of the same type as the pixels in a two-dimensional texture, but three-dimensional texture data focuses on describing the distribution of attributes within a spatial volume. Optionally, the number of texture data obtained in this application can be one or more. For example, if multiple texture data are obtained, different texture data can contain different texture information. For example, a first texture image and a second texture image are obtained. The first texture image contains color information and transparency information, and the second texture image contains roughness information.

[0058] The first data format refers to the way texture data is stored and represented; it defines the storage structure of texture data in computer memory or storage media. Illustratively, the first data format includes, but is not limited to: R32G32B32A32_SINT, R32G32B32A32_FLOAT, R32G32B32A32_UINT, R10G10B10A2_UNORM, etc.

[0059] Optionally, the first data format defines channels, channel bit depth, and channel data types. Channels include, but are not limited to, color channels, alpha channels, normal channels, depth channels, and roughness channels. Channel bit depth refers to the number of binary bits occupied by each channel, which determines the range of values ​​that the channel can represent. Channel data types include, but are not limited to, unsigned integers (UINT), signed integers (SINT), unsigned normalized integers (UNORM), signed normalized integers (SNORM), and floating-point numbers (FLOAT). For example, taking texture data containing color and alpha information, the first data format can be implemented as: R32G32B32A32_FLOAT, where R, G, B, and A represent the Red, Green, Blue, and Alpha channels, respectively. The number "32" after each channel indicates the channel bit depth, and "FLOAT" indicates that the channel data type is a floating-point number, meaning that the data for each channel is stored in 32-bit floating-point format. In this application, the first data format may also be referred to as the texture format, that is, the first data format is the first texture format.

[0060] The indication information is used to characterize the way texture data is processed in the graphics processing pipeline.

[0061] Optionally, the indication information includes, but is not limited to, at least one of decoding indication information, filtering indication information, and mixed indication information.

[0062] (1) Decoding instruction information is used to perform decoding processing on texture data in the graphics processing pipeline.

[0063] In a graphics processing pipeline, decoding texture data involves retrieving the texture data from memory and performing color space conversion and gamma correction. Illustratively, the decoding instructions include, but are not limited to, at least one of the following: color space conversion parameters, gamma correction parameters, etc.

[0064] (2) Filtering instructions are used to perform texture filtering on texture data in the graphics processing pipeline.

[0065] In the graphics processing pipeline, each pixel fragment is assigned texture coordinates (also known as target texture coordinates) during the texture mapping stage. The target texture coordinates specify the sampling position of the pixel fragment on the texture image (i.e., the texture data mentioned above). At least two texture information corresponding to the target texture coordinates are sampled in the texture image, and then interpolation calculation is performed on the at least two texture information to obtain the texture information applied in the pixel fragment. In this application, texture filtering processing is performed on the texture data, which is to say, interpolation calculation is performed on the at least two texture information corresponding to the target texture coordinates.

[0066] Among them, a pixel fragment is data generated during the rasterization stage of the graphics processing pipeline. Pixel fragments are used to determine the pixel value at each pixel location rendered on the screen.

[0067] Illustratively, a pixel fragment, also called a slice, is an intermediate result produced during the rasterization stage. It represents a potential pixel, or a candidate pixel, that may eventually be written into the screen's framebuffer and become a pixel on the screen.

[0068] Optionally, the filtering instruction information is used to indicate the interpolation processing method used when performing texture filtering processing on texture data. The interpolation processing method includes, but is not limited to, at least one of bilinear interpolation, trilinear interpolation, anisotropic interpolation, 3D texture interpolation, and max-min interpolation. It should be noted that the above examples of the types of interpolation processing methods are only illustrative, and this application does not limit the type and number of interpolation processing methods used in texture filtering processing. (3) The blending instruction information is used to perform texture blending processing on at least two texture data in the graphics processing pipeline.

[0069] In a graphics processing pipeline, during the texture mapping stage, for a given pixel fragment, texture filtering can determine a texture information from at least two texture images. During the pixel shading stage, the at least two texture information corresponding to the pixel fragment can be blended. For example, given a grass texture image and a stone texture image, during the texture filtering stage, for the pixel fragment, a first grass texture corresponding to the grass texture image and a first stone texture corresponding to the stone texture image are determined. During the pixel shading stage, the first grass texture and the first stone texture corresponding to the pixel fragment are blended, making certain areas on the grass appear as if there are protruding stones. In this application, performing texture blending processing on at least two texture data refers to blending at least two texture information corresponding to a pixel fragment.

[0070] Optionally, the blending indication information indicates the blending method for multiple texture data, including but not limited to at least one of additive blending, transparency blending, and multiplicative blending. It should be noted that the examples of blending methods above are merely illustrative and are not intended to limit the scope of the application.

[0071] It should be noted that the examples of indication information above are merely illustrative and are not intended to limit the scope of this application. This application primarily uses decoding and filtering indication information as examples for illustration.

[0072] In graphics processing pipelines, texture data comes in various formats; that is, there may be multiple types of primary data formats. To reduce the modeling complexity of texture data processing logic when modeling an image processing pipeline, this application converts texture data from multiple formats into a unified data format, namely a secondary data format, before processing the texture data. The specific process of converting to the secondary data format is described below through steps 320 and 330. In this application, the secondary data format can also be referred to as a texture format, that is, the secondary data format is a secondary texture format.

[0073] Step 320: Split the texture data according to the channel splitting rules corresponding to the first data format to obtain the first texture components corresponding to at least two channels respectively.

[0074] In texture data, a channel refers to the basic information unit that constitutes the texture data. Each channel represents a specific type of texture information. Illustratively, texture data channels include, but are not limited to, color channels (for storing color information), alpha channels (for storing alpha information), normal channels (for storing normal direction information), depth channels (for storing depth information), and roughness channels (for storing roughness information). Optionally, taking a texture image as an example, the texture information contained in each pixel / voxel of the texture image is composed of the texture information stored in at least two channels corresponding to the texture image.

[0075] Channel splitting rules are used to split texture data into channels corresponding to at least two channel data formats. That is, channel splitting rules define: (1) which channels the texture data is split into; and (2) the channel data format corresponding to each channel obtained from the splitting. For example, for texture data with the first data format R32G32B32A32_SINT, the texture data can be split into a red channel, a green channel, a blue channel, and a transparency channel, resulting in red components, green components, blue components, and transparency components, where the data format of the red components, green components, blue components, and transparency components is all SINT32.

[0076] In some embodiments, the first data format defines at least two channels, and the channel splitting rule corresponding to the first data format is to split the texture data according to the defined at least two channels. Optionally, based on splitting the texture data according to the at least two channels corresponding to the first data format, first texture components corresponding to at least two channels are obtained. Illustratively, texture data in RGBA format can be split into a red component corresponding to the red channel, a green component corresponding to the green channel, a blue component corresponding to the blue channel, and a transparency component corresponding to the transparency channel. The data format of the split first texture component is the channel data format of the channel corresponding to the first texture component. Optionally, the first data format defines the channel bit depth and channel data type corresponding to at least two channels, and the channel data format is also the channel bit depth and channel data type corresponding to the channel. Schematic: In the first data format, the same number of bits is defined for each channel by a single channel bit depth. For example, if the first data format is RGBA_SINT32, it means that the channel data format for the red, green, blue, and transparency channels all has 32 bits. Alternatively, the number of bits can be defined separately for each channel. For example, if the first data format is R32G16B32A16_SINT, it means that the channel data format for the red and blue channels has 32 bits, while the channel data format for the green and transparency channels has 16 bits. In the first data format, the same channel data type is defined for each channel through a single channel data type. For example, if the first data format is R32G32B32A32_SINT, it means that the channel data type for the red, green, blue, and transparency channels is SINT. Alternatively, a separate channel data type is defined for each channel. For example, if the first data format is R_SINT32G_Uint32B_SINT32A_UINT32, it means that the channel data type for the red and blue channels is SINT (signed integer), and the channel data type for the green and transparency channels is UINT (unsigned integer).

[0077] In some embodiments, the channel splitting rule corresponding to the first data format is determined by the format mapping relationship, which represents the mapping relationship between the data format and the channel splitting rule.

[0078] In some embodiments, the format mapping relationship includes a mapping relationship between a first data format and the channel data formats corresponding to at least two channels. This means that the channel splitting rule corresponding to the first data format splits the texture data into at least two channels. The data format for splitting the first texture component is the channel data format of its corresponding channel.

[0079] The format mapping relationship includes, but is not limited to, at least one of the following: format mapping table, configuration file, function mapping mechanism, etc., and this application does not limit it. The following explanation uses a format mapping table as an example to illustrate the format mapping relationship.

[0080] Optionally, a format mapping table is used to determine the channel splitting rules corresponding to the first data format. The format mapping table includes the mapping relationship between data formats and channel splitting rules. Illustratively, the format mapping table is a predefined set of rules used to map different data formats (such as the first data format) to their corresponding channel splitting rules. For texture data in the first data format, the format mapping table can be searched to find the channel splitting rule corresponding to the first data format. The format mapping table allows for quick searching of channel splitting rules for each data format, thereby improving the efficiency of texture data format conversion. Optionally, the format mapping table includes the mapping relationship between the first data format and the channel data formats corresponding to at least two channels.

[0081] Optionally, the channel data formats corresponding to at least two channels can be the same or different, and this is not limited here.

[0082] In some embodiments, the channel splitting rule corresponding to the first data format is used to split the texture data into a first channel corresponding to the first channel data format, a second channel corresponding to the second channel data format, a third channel corresponding to the third channel data format, and a fourth channel corresponding to the fourth data channel format. The first, second, third, and fourth channels are used to store different texture information corresponding to the texture data. Optionally, the texture data is split based on the channel splitting rule corresponding to the first data format to obtain a first texture component corresponding to the first channel, a first texture component corresponding to the second channel, a first texture component corresponding to the third channel, and a first texture component corresponding to the fourth channel. Illustratively, the channel splitting rule corresponding to the first data format is used to split the texture data into a red channel corresponding to the red channel data format, a green channel corresponding to the green channel data format, a blue channel corresponding to the blue channel data format, and a transparency channel corresponding to the transparency data channel format. That is, the texture data is split based on the channel splitting rule corresponding to the first data format to obtain a red component corresponding to the red channel, a green component corresponding to the green channel, a blue component corresponding to the blue channel, and a transparency component corresponding to the transparency channel.

[0083] It should be noted that the above explanation only uses the implementation of the first, second, third, and fourth channels as a red channel, green channel, blue channel, and transparency channel as an example. In this application, the first, second, third, and fourth channels can also be implemented as other texture information. The number of channels obtained by splitting the texture data can be more or less than 4, and this is not limited here. For example, the texture data can be split to obtain the luminance component corresponding to the luminance channel, the blue chrominance component corresponding to the blue chrominance channel, and the red chrominance component corresponding to the red chrominance channel (i.e., the YCbCr color model).

[0084] In some embodiments, the format mapping relationship includes the mapping relationship between the first data format and the red channel data format, green channel data format, blue channel data format and transparency channel data format, respectively.

[0085] Optionally, the texture data is split based on the channel splitting rules corresponding to the first data format to obtain the red component corresponding to the red channel, the green component corresponding to the green channel, the blue component corresponding to the blue channel, and the transparency component corresponding to the transparency channel; wherein, the data format of the red component is the red channel data format; the data format of the green component is the green channel data format; the data format of the blue component is the blue channel data format; and the data format of the transparency component is the transparency channel data format.

[0086] The format mapping table defines the mapping relationship between the first data format and the red channel data format, green channel data format, blue channel data format and alpha channel data format, which means that the channel splitting rule corresponding to the first data format is used to split the texture data according to the red channel, green channel, blue channel and alpha channel.

[0087] In the above scheme, the format mapping table achieves channel splitting of texture data by defining the mapping relationship between data formats and different channel data formats. For example, for RGBA format texture data, the format mapping table defines the data formats for red, green, blue, and alpha channels, thereby achieving RGBA data splitting. The format mapping table can flexibly define mapping relationships for multiple data formats, thus supporting texture data processing of various data formats.

[0088] Please refer to Table 1, which shows a format mapping table. As shown in Table 1, the list item "Data Format" represents the data format of the texture data, such as the first data format. The list item "channel_0" represents the first channel data format, such as the red channel data format. The list item "channel_1" represents the second channel data format, such as the green channel data format. The list item "channel_2" represents the third channel data format, such as the blue channel data format. The list item "channel_3" represents the fourth channel data format, such as the transparency channel data format.

[0089] Table 1

[0090]

[0091]

[0092] In Table 1, SINT represents a signed integer, FLOAT represents a floating-point number, UINT represents an unsigned integer, and UNORM represents a signed integer.

[0093] Step 330: Perform format conversion processing on the first texture components corresponding to at least two channels according to the preset second data format to obtain the second texture components corresponding to at least two channels.

[0094] The second texture component is data in a second data format. That is, the data formats of the first texture components corresponding to at least two channels are uniformly converted to the second data format. For example, if the data formats of the split red component, green component, blue component, and alpha component are all in the second data format, then the red, green, blue, and alpha channel data formats are all converted to the second data format. Optionally, the second data format includes, but is not limited to, at least one of fixed-point format, integer format, etc.

[0095] In some embodiments, when the data format of the first texture component is different from the second data format, the first texture component is converted according to the preset second data format to obtain the second texture component corresponding to the first texture component.

[0096] This example illustrates the process of checking the data format of each first texture component. If the data format of a first texture component is already the second data format, then no format conversion is needed for that first texture component. If the data format of a first texture component is not the second data format, then format conversion is needed for that first texture component. It should be noted that if the second data format is Q4.11 (fixed-point format) and the data format of the first texture component is Q3.12 (fixed-point format), the data formats of the first texture component are different from the second data format, and format conversion is still required for the first texture component.

[0097] Let's take the second data format, implemented as a fixed-point number, as an example. Fixed-point number format uses a fixed decimal point position to represent real numbers, and its structure can generally be represented as Qm.n. Here, m represents the number of digits in the integer part, and n represents the number of digits in the decimal part. The entire fixed-point number occupies a total of m+n bits, with the sign bit included in the m bits. For example: Q15.16: 15 integer digits, 16 decimal digits, with the sign bit included in the 15 integer digits. Q7.0: 7 integer digits, no decimal part, with the sign bit included in the 7 integer digits.

[0098] Optionally, a format conversion process is performed on the first texture components corresponding to at least two channels according to a fixed-point format to obtain the second texture components corresponding to at least two channels, wherein the second texture components are data in a fixed-point format.

[0099] The methods for converting the first texture component of different data formats into a fixed-point format vary.

[0100] (1) If the data format of the first texture component is integer format (UINT / SINT):

[0101] Integer format (UINT / SINT) is a special fixed-point number format that does not have a decimal part.

[0102] For unsigned integers (UINT), suppose we want to convert a k-bit unsigned integer to a fixed-point number in Qm.n format: determine the scaling factor 2 for the fixed-point number format. n Divide the unsigned integer by the scaling factor, which is equivalent to dividing the unsigned integer by 2. n Unsigned integer ÷ 2 n This refers to the second texture component in the converted fixed-point format. If k < m + n, zeros need to be padded in the high bits; if k > m + n, the high bits need to be truncated.

[0103] For signed integers (SINT), suppose we want to convert a k-bit signed integer to a fixed-point number in Qm.n format: determine the scaling factor 2 for the fixed-point number format. nDivide a signed integer by a scaling factor, which is equivalent to dividing a signed integer by 2. n ÷ 2 of a signed integer n This refers to the second texture component in the converted fixed-point format. If k < m + n, a sign bit needs to be padded in the high-order bits (arithmetic right shift); if k > m + n, the high-order bits need to be truncated.

[0104] (2) If the data format of the first texture component is normalized integer format (UNORM / SNORM):

[0105] Normalized integer format (UNORM / SNORM) is also a special fixed-point number format, which is usually normalized to a preset normalization range, such as [0, 1] (UNORM) or [-1, 1] (SNORM).

[0106] For unsigned normalized integers (UNORM), suppose we want to convert an unsigned normalized integer in the range [0, 1] to a fixed-point number in Qm.n format: The converted fixed-point number = unsigned normalized integer × (2... m -1)×2 n Unsigned normalized integer × (2 m -1)×2 n That is, the second texture component in the fixed-point format obtained by conversion.

[0107] For signed normalized integers (SNORM), suppose we want to convert a signed normalized integer in the range [-1, 1] to a fixed-point number in Qm.n format: The converted fixed-point number = signed normalized integer × (2... m-1 -1)×2 n Signed normalized integer × (2 m-1 -1)×2 n That is, the second texture component in the fixed-point format obtained by conversion.

[0108] In some embodiments, for the Normalized Integer Format (UNORM / SNORM), the first texture component of the UNORM / SNORM is bit-extended. Bit extension increases the number of data bits in the first texture component; for example, 8-bit UNORM / SNORM is bit-extended to 16-bit UNORM / SNORM. This bit extension can be achieved by adding zeros to the high bits of the first texture component (for unsigned data) or copying the sign bit (for signed data). The bit-extended first texture component of the UNORM / SNORM is then used as the texture component of the Integer Format (UINT / SINT), and converted according to the format conversion method corresponding to the Integer Format (UINT / SINT).

[0109] (3) If the data format of the first texture component is floating-point format (FLOAT):

[0110] The fixed-point number obtained by the transformation = round(a×2) n ), where 'a' is a floating-point number, and 'round' represents a rounding operation (such as rounding to the nearest integer, rounding down, rounding up). The rounding operation is used to round a floating-point number to the nearest integer. The fixed-point number Qm.n has a range of [-2^n]. m-1 ,2 m-1 -2 -n (with symbols), round(a×2) n The result of round(a×2) may exceed the range of Qm.n. If it does, you can adjust the range of round(a×2) by round(a×2) n ) Take measures such as truncation (discarding the high-order bits directly) or saturation (limiting the value to [-2)). m-1 ,2 m -1 -2 -n ]Inside).

[0111] In some embodiments, a format conversion code is invoked according to the data format corresponding to the first texture component, and the format conversion code is executed to convert the first texture component into a second texture component with a second data format (e.g., fixed-point format). For example, if the data format corresponding to the first texture component is a floating-point format, the format conversion code corresponding to the floating-point format is invoked and executed to convert the first texture component into a second texture component with a fixed-point format.

[0112] Step 340: Process the second texture components corresponding to at least two channels according to the processing method indicated by the instruction information to obtain the texture processing result.

[0113] As can be seen from the above, the indication information includes, but is not limited to, at least one of the following: decoding indication information, filtering indication information, and mixed indication information.

[0114] In some embodiments, the texture processing result includes, but is not limited to, at least one of texture decoding result, texture filtering result, and texture blending result.

[0115] Optionally, the second texture components corresponding to at least two channels are processed according to the decoding method indicated by the decoding indication information to obtain a texture decoding result. Optionally, the second texture components corresponding to at least two channels are processed according to the texture filtering method indicated by the filtering indication information to obtain a texture filtering result. Optionally, the second texture components corresponding to at least two channels are processed according to the texture blending method indicated by the blending indication information to obtain a texture blending result.

[0116] In some embodiments, the second data format includes a fixed-point number format. Optionally, at least two channels corresponding to the second texture components are processed in the fixed-point number field according to the processing method indicated by the indication information to obtain the texture processing result, and the fixed-point number field is used to characterize the data processing and data representation using the fixed-point number format.

[0117] Fixed-point number arithmetic has low computational complexity. In graphics processing pipelines, using fixed-point number format for data processing can significantly improve processing speed and reduce the consumption of computing resources.

[0118] Optionally, after obtaining the texture processing result, a format conversion process is performed on the texture processing result according to the format conversion requirements to obtain the converted texture processing result, which is then input into the graphics processing pipeline. The format conversion requirements refer to the required format of the texture processing result in the graphics processing pipeline. For example, if the texture processing result is implemented as a texture filtering result, and in the graphics processing pipeline, the texture filtering result needs to be input into the pixel shader for further processing, then after obtaining the texture processing result in the second data format, a format conversion process is performed on the texture processing result based on the data format required by the pixel shader, converting the texture processing result into the data format required by the pixel shader.

[0119] In some embodiments, based on the processing method indicated by the instruction information, at least two channels corresponding to the second texture components are processed in parallel to obtain the texture processing result. By splitting the texture data into at least two texture components through channel splitting rules, data transformation of at least two texture components can be performed in parallel, thereby further improving the development efficiency of the GPU.

[0120] In summary, the texture data processing method provided in this application, after acquiring texture data, converts texture data of any format (such as the first data format) into texture data of a unified format (i.e., the second data format) through channel splitting rules and a preset second data format. Then, it processes the texture data of the unified format according to the instruction information to obtain the texture processing result. Since there is no need to pay attention to the format difference of texture data when processing texture data, it avoids designing different processing flows for texture data of different formats, thereby improving the testing efficiency of GPU. In addition, in this application, the texture data is split into at least two texture components through channel splitting rules, which enables parallel data conversion of at least two texture components, thereby further improving the testing efficiency of GPU.

[0121] Please refer to Figure 4 , Figure 4 This diagram illustrates a module schematic of the texture mapping stage in a graphics processing pipeline, such as... Figure 4As shown, in the graphics processing pipeline, a texture decoding module 410 and a texture filtering module 420 can be modeled for the texture mapping stage 400. The texture decoding module 410 is used to retrieve texture data from memory and decode it, while the texture filtering module 420 is used to determine the texture information applied to each pixel segment based on the texture data output by the texture decoding module 410. The texture data processing method provided in this application can be applied to at least one of the texture decoding module 410 and the texture filtering module 420. The texture data processing methods in the texture decoding module 410 and the texture filtering module 420 are described below.

[0122] (I) Texture Decoding Module - Texture Data Decoding Method

[0123] In some embodiments, the indication information includes decoding indication information, and the texture processing result includes the texture decoding result. For illustrative purposes, please refer to... Figure 5 , Figure 3 The illustrated embodiment can also be implemented as steps 510 to 540, which can be executed by the texture decoding module 410.

[0124] Step 510: Obtain decoding instruction information and texture data in the first data format.

[0125] Optionally, the first data format defines the channel, the number of channel bits, and the channel data type.

[0126] Decoding instructions are used to perform decoding processing on texture data in the graphics processing pipeline. Illustratively, taking texture data implemented as a texture image as an example, in the graphics processing pipeline, performing decoding processing on texture data means retrieving the texture image from memory and performing color space conversion and gamma correction.

[0127] In some embodiments, before obtaining the decoding indication information and the texture data in the first data format, the method further includes: obtaining compressed texture data; performing decompression processing on the compressed texture data to obtain texture data in the first data format.

[0128] In a graphics processing pipeline, texture data is typically stored in a compressed format (i.e., compressed texture data) to reduce storage space and improve loading efficiency. Compressed texture data can be obtained in various ways, such as reading from files, transmitting over a network, or acquiring it from other data sources. Common compression formats include DXT (DirectX Texture), ASTC (Adaptive Scalable Texture Compression), and PVRTC (PowerVR Texture Compression). The purpose of decompression is to convert the compressed texture data into an uncompressed primary data format for subsequent processing and rendering.

[0129] Optionally, the decompression code corresponding to the compression format is called, and the decompression code is executed to decompress the texture data in the compressed format to obtain the texture data in the first data format. Illustratively, after determining the compression format of the texture data, the corresponding decompression code is used to decompress the compressed texture data. The decompressed texture data is usually in the uncompressed data format, i.e., the first data format.

[0130] In the above scheme, the processing of compressed texture data is achieved by obtaining texture data in compressed format and performing decompression processing on the compressed texture data to obtain texture data in the first data format.

[0131] Step 520: Split the texture data according to the channel splitting rules corresponding to the first data format to obtain the first texture components corresponding to at least two channels respectively.

[0132] In some embodiments, the channel splitting rule corresponding to the first data format is used to split the texture data into a first channel corresponding to the first channel data format, a second channel corresponding to the second channel data format, a third channel corresponding to the third channel data format, and a fourth channel corresponding to the fourth data channel format. The first, second, third, and fourth channels are used to store different texture information corresponding to the texture data. Optionally, the texture data is split based on the channel splitting rule corresponding to the first data format to obtain a first texture component corresponding to the first channel, a first texture component corresponding to the second channel, a first texture component corresponding to the third channel, and a first texture component corresponding to the fourth channel.

[0133] Step 530: Perform format conversion processing on the first texture components corresponding to at least two channels according to the preset second data format to obtain the second texture components corresponding to at least two channels.

[0134] The second texture component is data in the second data format.

[0135] Optionally, a format conversion process is performed on the first texture components corresponding to at least two channels according to a fixed-point format to obtain the second texture components corresponding to at least two channels, wherein the second texture components are data in a fixed-point format.

[0136] Step 540: Based on the decoding instruction information, perform decoding processing on the second texture components corresponding to at least two channels respectively to obtain the texture decoding result.

[0137] Optionally, the decoding instruction information determines the specific decoding method for the second texture component. For example, the decoding instruction information includes color space conversion parameters and gamma correction parameters.

[0138] In some embodiments, the color space conversion parameters and gamma correction parameters are obtained by parsing the decoding indication information; color space conversion processing is performed on the second texture components corresponding to at least two channels according to the color space conversion parameters to obtain the third texture components corresponding to at least two channels respectively; gamma correction processing is performed on the third texture components corresponding to at least two channels according to the gamma correction parameters to obtain the texture decoding result.

[0139] Optionally, the color space conversion parameter can be implemented to specify a specific color space type (e.g., YUV color space), or the color space conversion parameter can be implemented to convert a color space type to another color space type, such as RGB→YUV; the gamma correction parameter can indicate whether gamma correction is enabled. When gamma correction is enabled, the gamma correction parameter can also include a gamma value, which can be a parameter manually set by the developer or a parameter automatically obtained.

[0140] Indicatively, based on the color space conversion parameters, if the instruction is to convert the RGB color space to the YUV color space, the channel values ​​corresponding to R, G, and B are converted into the channel values ​​corresponding to Y (luminance), U (chrominance), and V (chrominance) respectively, according to a preset mathematical formula. If the gamma correction parameter indicates that gamma correction is enabled and the gamma value is specified as γ, then gamma correction is performed on the channel values ​​corresponding to Y, U, and V respectively using the gamma value γ, thereby obtaining the texture decoding result.

[0141] In the above scheme, the texture data is decoded by color space conversion parameters and gamma correction parameters, which ensures the accuracy of color space conversion and gamma correction. Furthermore, by performing color space conversion and gamma correction in steps, the complexity of decoding texture data is reduced.

[0142] In some embodiments, after obtaining the texture decoding result, the texture decoding result is used as the texture data input to the texture filtering module. Optionally, the texture decoding result is subjected to format conversion processing according to the format conversion requirements of the texture filtering module to obtain a converted texture decoding result, and the converted texture decoding result is input to the texture filtering module.

[0143] In summary, the texture data processing method provided in this application, after acquiring texture data, converts texture data of any format into texture data of a unified format through channel splitting rules and a preset second data format. Then, it decodes the texture data of the unified format according to decoding instruction information to obtain the texture decoding result. Since there is no need to pay attention to the format differences of texture data when decoding texture data, it avoids designing different decoding processes for texture data of different formats, thereby improving the decoding efficiency of the GPU.

[0144] This is illustrative; please refer to it. Figure 6 This diagram illustrates a texture data processing method executed by a texture decoding module 410. The texture decoding module 410 includes the following units: a decoder pipeline unit 601, a texture decompression unit 602, a format table unit 603, a format conversion method poll unit 604, a color space conversion unit 605, and a gamma correction unit 606. The method includes the following steps:

[0145] 1. Decoding pipeline unit 601 acquires texture data.

[0146] The decoding pipeline unit 601 first obtains texture data from a storage device, network, or other data source. This texture data is in a compressed format, such as DXT or ASTC, to save storage space and improve loading efficiency. After obtaining the texture data, the decoding pipeline unit 601 inputs the texture data into the texture decompression unit 602.

[0147] 2. Texture decompression unit 602 decompresses texture data.

[0148] The texture decompression unit 602 calls the decompression code corresponding to the compression format to decompress the texture data, obtaining the decompressed texture data. After obtaining the decompressed texture data, the texture decompression unit 602 inputs the decompressed texture data into the format table unit 603.

[0149] 3. Format table unit 603 obtains four-channel data and their corresponding channel data formats.

[0150] The format table unit 603 stores a format mapping table (see Table 1 for reference). Taking the data format of the decompressed texture data as R32G32B32A32_SINT as an example.

[0151] The decompressed texture data is divided into four channels using a format mapping table: the red component (R channel), the green component (G channel), the blue component (B channel), and the alpha component (A channel). These are referred to as four-channel data. Furthermore, the format mapping table converts R32G32B32A32_SINT into a 4-channel array {channel_0_format, channel_1_format, channel_2_format, channel_3_format}, where channel_0_format represents the red channel data format (SINT32) for the red component, channel_1_format represents the green channel data format (SINT32) for the green component, channel_2_format represents the blue channel data format (SINT32) for the blue component, and channel_3_format represents the alpha channel data format (SINT32) for the alpha component.

[0152] The format table unit 603 obtains the four-channel data and their corresponding channel data formats (i.e., the array {channel_0_format, channel_1_format, channel_2_format, channel_3_format}) and inputs them into the format conversion method pool unit 604.

[0153] 4. Format Conversion Method: Pool unit 604 converts the channel data format corresponding to the four channels into a fixed-point format.

[0154] The format conversion method pool unit 604 is used to implement the conversion between channel data format and fixed-point format. For example, the red channel data format (SINT32), green channel data format (SINT32), blue channel data format (SINT32), and transparency channel data format (SINT32) obtained above are all converted to fixed-point format.

[0155] Optionally, the format conversion method pool unit 604 calls the format conversion code according to the channel data format corresponding to the target channel (such as R channel, G channel, B channel, or A channel), and executes the format conversion code to convert the channel data format of the target channel to a fixed-point format. After all four channels are converted, the fixed-point format channel data corresponding to the four channels is obtained, hereinafter referred to as the fixed-point format four-channel data.

[0156] The format conversion method pool unit 604 inputs four-channel data in fixed-point format into the color space conversion unit 605.

[0157] 5. Decoding pipeline unit 601 determines the color space conversion parameters and gamma correction parameters.

[0158] The decoding pipeline unit 601 parses the decoding status word (decoding indication information) to obtain the color space conversion parameters and gamma correction parameters. The decoding pipeline unit 601 inputs the color space conversion parameters into the color space conversion unit 605 and the gamma correction parameters into the gamma correction unit 606.

[0159] 6. The color space conversion unit 605 performs color space conversion in the fixed-point domain.

[0160] Color space conversion unit 605 performs color space conversion on the fixed-point format four-channel data in the fixed-point domain according to the color space conversion parameters to obtain the converted four-channel data; color space conversion unit 605 inputs the converted four-channel data into gamma correction unit 606.

[0161] 7. The gamma correction unit 606 performs gamma correction in the fixed-point number domain.

[0162] The gamma correction unit 606 performs gamma correction on the converted four-channel data in the fixed-point number domain according to the gamma correction parameters to obtain the corrected four-channel data; the corrected four-channel data is then input into the format conversion method pool unit 604.

[0163] 8. Format Conversion Method: Pool unit 604 converts fixed-point number format to a specified format.

[0164] The format conversion method pool unit 604 converts the data format (fixed-point format) of the corrected four-channel data into a specified format, which can be the input data format required by the texture filtering module.

[0165] 9. Decoding pipeline unit 601 packages and outputs data.

[0166] The decoding pipeline unit 601 packages and outputs four-channel data in a specified format.

[0167] 10. The decoding pipeline unit 601 sends data to the GPU pipeline.

[0168] Indicatively, the decoding pipeline unit 601 inputs packaged data in a specified format to the texture filtering module.

[0169] (II) Texture Filtering Module - Texture Data Filtering Method

[0170] In some embodiments, the indication information includes filtering indication information, and the texture processing result includes a texture filtering result. For illustrative purposes, please refer to... Figure 7 , Figure 3 The illustrated embodiment can also be implemented as steps 710 to 740 below, which can be executed by the texture filtering module 420.

[0171] Step 710: Obtain the filtering instruction information and the texture data in the first data format.

[0172] Filtering instructions are used to perform texture filtering on texture data in the graphics processing pipeline.

[0173] Optionally, texture data includes texture images corresponding to pixel fragments. Illustratively, in a graphics processing pipeline, pixel fragments are data generated during the rasterization stage and destined for texture filtering. Taking a target pixel fragment as an example, the data corresponding to the target pixel fragment includes at least: target texture coordinates and target screen coordinates, where the target screen coordinates indicate the screen pixel position corresponding to the target pixel fragment, and the target pixel fragment determines the pixel value rendered to the screen at the target screen coordinates. Texture images are texture image data (such as color maps and normal maps) stored in video memory, used to provide surface texture information (color, material, lighting, etc.) for pixel fragments. In this application, texture filtering processing is the process of sampling from the texture image and calculating the final texture information applied to the pixel fragment based on the target texture coordinates corresponding to the pixel fragment.

[0174] In some embodiments, the filtering indication information is used to indicate the interpolation method used when performing texture filtering on texture data.

[0175] Optionally, the filtering indication information may indicate whether a preset interpolation processing method is activated. If a certain interpolation processing method is activated, the filtering indication information may also include the interpolation parameters of that interpolation processing method (such as bilinear interpolation u and v coordinates, MipMap layer number lod, etc.). The preset interpolation processing method includes, but is not limited to, at least one of bilinear interpolation, trilinear interpolation, anisotropic interpolation, 3D texture interpolation, max-min interpolation, and MipMap (multi-level asymptotic) interpolation. This application does not limit this aspect.

[0176] For illustration, please refer to Table 2, which shows the input format for filter instructions and texture data (i.e., color values).

[0177] Table 2

[0178]

[0179] It should be noted that the input format for the color values ​​in Table 2 is: Vector <uint32>,Vector <uint32>An Enum is a container representing color values, used to store specific numbers, and its length is variable. The Enum tag is used to constrain the color format type. The color format is also the first data format mentioned above.

[0180] Step 720: Split the texture data based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel.

[0181] Optionally, the texture image is split based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel.

[0182] Schematic, the channel splitting rules corresponding to the first data format are used to split the texture image into a first channel corresponding to the first channel data format, a second channel corresponding to the second channel data format, a third channel corresponding to the third channel data format, and a fourth channel corresponding to the fourth data channel format. The first, second, third, and fourth channels are used to store different texture information corresponding to the texture image. Optionally, the texture image is split based on the channel splitting rules corresponding to the first data format to obtain a first texture component corresponding to the first channel, a first texture component corresponding to the second channel, a first texture component corresponding to the third channel, and a first texture component corresponding to the fourth channel.

[0183] Step 730: Perform format conversion processing on the first texture components corresponding to at least two channels according to the preset second data format to obtain the second texture components corresponding to at least two channels.

[0184] The second texture component is data in the second data format.

[0185] Optionally, a format conversion process is performed on the first texture components corresponding to at least two channels according to a fixed-point format to obtain the second texture components corresponding to at least two channels, wherein the second texture components are data in a fixed-point format.

[0186] Step 740: Perform texture filtering processing on the second texture components corresponding to at least two channels based on the filtering instruction information to obtain the texture filtering result.

[0187] In some embodiments, taking texture data implemented as a texture image as an example, the method for obtaining texture filtering results further includes the following steps:

[0188] Step 1: The interpolation parameters and target texture coordinates are obtained by parsing the filtering instruction information.

[0189] The interpolation parameter is used to characterize the interpolation processing method for texture data. The interpolation processing method indicated by the interpolation parameter includes, but is not limited to, at least one of bilinear interpolation, MipMap interpolation, anisotropic interpolation, and 3D interpolation.

[0190] For the interpolation parameters, please refer to Table 2 for illustration. Identify the "DoBilinear" and / or "Bilinear_uv" data in the filter indication information as interpolation parameters for bilinear interpolation: Use the "DoBilinear" data to determine whether bilinear interpolation needs to be performed (1 indicates yes, 0 indicates no). If bilinear interpolation needs to be performed, obtain the bilinear interpolation u and v coordinates indicated by the "Bilinear_uv" data. Identify the "DoMipMap" and / or "MipMap_lod" data in the filter indication information as interpolation parameters for MipMap interpolation: Use the "DoMipMap" data to determine whether MipMap interpolation needs to be performed (1 indicates yes, 0 indicates no). If MipMap interpolation needs to be performed, obtain the MipMap layer number lod indicated by the "MipMap_lod" data. Identify the "DoAnisotropic" and / or "AnisotropicNum" data in the filter instruction information as interpolation parameters for anisotropic interpolation: determine whether anisotropic interpolation needs to be performed using the "DoAnisotropic" data (1 indicates yes, 0 indicates no). If anisotropic interpolation needs to be performed, obtain the anisotropic sampling number indicated by the "AnisotropicNum" data. Identify the "Do3D" data in the filter instruction information as interpolation parameters for 3D interpolation: determine whether 3D interpolation needs to be performed using the "Do3D" data (1 indicates yes, 0 indicates no).

[0191] The target texture coordinates (usually called uv coordinates) are used to indicate the sampling position of a pixel fragment in the texture image. Illustratively, the target texture coordinates of a pixel fragment are typically determined during the rasterization stage. During rasterization, the target texture coordinates of the pixel fragment are calculated based on the vertex information of the geometric primitives. Taking a triangular primitive as an example, each triangular primitive corresponds to one pixel fragment. In the texture image, the texture coordinates corresponding to the three vertices of the triangular primitive are the first texture coordinate (u2, v2), the second texture coordinate (u3, v3), and the third texture coordinate (u4, v4), respectively. By performing a weighted average of the first, second, and third texture coordinates based on the centroid coordinates of the triangular primitive, the target texture coordinates (u, v) of the pixel fragment can be obtained. For illustration, the centroid coordinates are (x, y, z). After normalizing (x, y, z), we get (x1, y1, z1), where u = x1×u2 + y1×u3 + z1×u4 and v = x1×v2 + y1×v3 + z1×v4.

[0192] Step 2: Based on the interpolation parameters and the target texture coordinates, at least two texture coordinates are determined in the texture image; based on the interpolation parameters and the target distance, the interpolation weights corresponding to the at least two texture coordinates are determined; based on the interpolation weights corresponding to the at least two texture coordinates, a weighted summation process is performed on the second texture component of the i-th channel corresponding to the at least two texture coordinates to obtain the channel filtering result corresponding to the i-th channel, where i is a positive integer and the value of i is from 1 to N, and N represents the number of channels of at least two channels.

[0193] Target distance refers to the distance between target texture coordinates and texture coordinates.

[0194] Different interpolation parameters represent different filtering methods. Different filtering methods sample different texture coordinates in the texture image, thereby determining different interpolation weights. In this application, texture filtering is performed independently on the texture data (i.e., the second texture component) of each channel based on the interpolation weights. The following describes the methods for determining the channel filtering results using bilinear interpolation, MipMap interpolation, anisotropic interpolation, and 3D interpolation, taking the i-th channel as an example.

[0195] (1) Bilinear interpolation

[0196] Bilinear interpolation is used to perform linear interpolation in the horizontal and vertical directions using the known values ​​of four neighboring points, ultimately obtaining an estimated value for the target point. In this application, the interpolation parameters in bilinear interpolation include bilinear interpolation u and v coordinates, which are also the aforementioned target texture coordinates. In the texture image, the texture coordinates of the four corner points of the texel (similar to a pixel) grid where the target texture coordinates (u, v) are located are also at least two texture coordinates corresponding to the target texture coordinates. Assume the texture coordinates of the four corner points of the texel grid where the target texture coordinates (u, v) are located are: (u0, v0), (u1, v0), (u0, v1), and (u1, v1).

[0197] Then, calculate the normalized distances a and b, where a = (u - u0) ÷ (u1 - u0) and b = (v - v0) ÷ (v1 - v0). The interpolation weights corresponding to the texture coordinates of the four corner points are then:

[0198] w1 = (1-a)×(1-b), w2 = a×(1-b), w3 = (1-a)×b, w4 = a×b. The interpolation weights reflect the spatial proximity of the target texture coordinates to each corner point (the closer the distance, the higher the weight). If, on the texture image, (u0, v0), (u1, v0), (u0, v1), and (u1, v1) correspond to the second texture components of the i-th channel as C0, C1, C2, and C3 respectively, then the channel filtering result of the i-th channel is:

[0199] C=w1×C0+w2×C1+w3×C2+w4×C3.

[0200] (2) MipMap interpolation

[0201] A MipMap is a collection of pre-computed texture images, containing multi-level scaled-down versions of the original texture image (i.e., the texture image obtained in step 710 above). These texture images are stored in a pyramid format. Typically, the texture image at the current MipMap level is half the resolution of the texture image at the previous MipMap level. For example, a 512x512 resolution original texture image will have a corresponding MipMap pyramid including 256x256, 128x128, 64x64, and so on, up to a resolution of 1x1. MipMap interpolation refers to interpolating between textures of different resolutions. The interpolation parameters for MipMap interpolation include the MipMap level lod, where lod represents the level L of the current target texture coordinates (u, v).

[0202] When lod is an integer, bilinear interpolation (intra-layer interpolation) is performed directly on the texture image of layer L, wherein the method for determining the channel filtering result of the i-th channel is described in (1) above.

[0203] If lod is not an integer, such as lod = 2.3, it means that the target texture coordinates (u, v) need to be interpolated between level 2 (L) and level 3 (L+1) (inter-level interpolation). The level weight is determined by the decimal part of lod. If lod = 2.3, the level weight of level 2 is 0.7 and the level weight of level 3 is 0.3. That is, bilinear interpolation is performed on the texture image of level L and the texture image of level L+1 respectively to obtain the channel filtering result C of the i-th channel in the texture image of level L. L The channel filtering result C of the i-th channel in the texture image of level L+1. L+1 C is determined L and C L+1 The method is described in (1) above. Then, the channel filtering result C is adjusted according to the layer weight w5 corresponding to the texture image of layer L and the layer weight w6 corresponding to the texture image of layer L+1. L and channel filtering results C L+1 Perform a weighted summation process to obtain the channel filtering result for the i-th channel, which is w5×C. L +w6×C L+1 .

[0204] (3) Anisotropic interpolation

[0205] Anisotropic interpolation is an optimization method for textures that are non-uniformly stretched in screen space (such as oblique or perspective). It reduces blur and preserves details by sampling more texels in different directions. Its core idea is to adjust the sampling direction and density according to the gradient of the target texture coordinates, and it is especially suitable for textured surfaces viewed at an oblique angle (such as the ground, walls, etc.).

[0206] In this application, the anisotropic interpolation step includes: based on the texture gradient at the target texture coordinates (u, v) Calculate the anisotropy direction (direction of maximum rate of change); uniformly sample n sampling points along the anisotropy direction (i.e., at least two texture coordinates corresponding to the target texture coordinates), where n represents the number of anisotropic samples. The interpolation parameters corresponding to anisotropic interpolation include the number of anisotropic samples n, where n is an integer greater than 1; each sampling point has the same interpolation weight (e.g., 1 / n), or the interpolation weights corresponding to the n sampling points are determined based on the distances between the n sampling points and the target texture coordinates; perform weighted summation on the second texture component of the i-th channel corresponding to the n sampling points based on the interpolation weights corresponding to the n sampling points to obtain the channel filtering result of the i-th channel.

[0207] (4) 3D interpolation

[0208] 3D interpolation is the process of interpolating the coordinates of a target texture in a three-dimensional texture space (i.e., the texture data is three-dimensional texture data). The target texture coordinates are points in the three-dimensional texture space, denoted as (u, v, w). Illustratively, in a three-dimensional texture image, the texture coordinates of the eight corner points within a three-dimensional texel (similar to a voxel) containing the target texture coordinates (u, v, w) are the at least two texture coordinates corresponding to the target texture coordinates, denoted as: (u0, v0, w0), (u1, v0, w0), (u0, v1, w0), (u1, v1, w0), (u0, v0, w1), (u1, v0, w1), (u0, v1, w1), (u1, v1, w1). The normalized distance is calculated as a = (u - u0) ÷ (u1 - u0), b = (v - v0) ÷ (v1 - v0) v0), c=(w-w0)÷(w1-w0); then the interpolation weights corresponding to the texture coordinates of the 8 corner points are: w000=(1-a)×(1-b)×(1-c); w100=a×(1-b)×(1-c); w010=(1-a)×b×(1-c); w110=a×b×(1-c); w001=(1-a)×(1-b)×c; w101=a×(1-b)×c; w011=(1-a)×b×c; w111=a×b×c; if the second texture component of the i-th channel corresponding to the texture coordinates of the 8 corner points on the texture image is C000, C100, C010, C110, C001, C101, C011 and C11, then the channel filtering result of the i-th channel is:

[0209] C=w000×C000+w100×C100+w010×C010+w110×C110+w001×C001+w101×C101+w011×C011+w111×C111.

[0210] In other embodiments, the interpolation parameters are obtained by parsing the filtering instruction information, and the interpolation weights corresponding to the interpolation parameters are also obtained. That is, after obtaining the interpolation parameters, the interpolation weights corresponding to the interpolation parameters are directly obtained without additional calculation, for example, by directly looking up the interpolation parameters in a table. After obtaining the interpolation weights, a weighted summation process is performed on the second texture components corresponding to at least two texture coordinates based on the interpolation weights corresponding to at least two texture coordinates, to obtain the channel filtering result corresponding to the i-th channel.

[0211] Optionally, the interpolation code is invoked; the interpolation code is executed to perform a weighted summation process on the second texture components corresponding to at least two texture coordinates based on the interpolation weights corresponding to at least two texture coordinates, so as to obtain the channel filtering result corresponding to the i-th channel.

[0212] For illustration, if the interpolation parameters indicate the existence of bilinear interpolation, taking the i-th channel as an example, the bilinear interpolation code is called and executed. The bilinear interpolation code performs a weighted summation on the second texture components of the i-th channel corresponding to the four corner texture coordinates using the interpolation weights corresponding to the four corner texture coordinates, and obtains the channel filtering result corresponding to the i-th channel. Let the second texture components of the i-th channel (R channel) corresponding to the four corner texture coordinates be R1, R2, R3, and R4, then the channel filtering result of the R channel is w1×R1+w2×R2+w3×R3+w4×R4.

[0213] To illustrate, if the interpolation parameters indicate the presence of MipMap interpolation, let's take the example of performing MipMap interpolation between level 2 and level 3: Taking the i-th channel as an example, obtain the interpolation weights corresponding to the texture coordinates of the four corner points of u and v in level 2, and obtain the interpolation weights corresponding to the texture coordinates of the four corner points of u and v in level 3; call the bilinear interpolation code, execute the code twice to obtain the channel filtering result R2 corresponding to the i-th channel (R channel) of level 2 and the channel filtering result R3 corresponding to the i-th channel of level 3; then call the MipMap interpolation code again, execute the code, assuming that the level weight of level 2 is 0.7 and the level weight of level 3 is 0.3, then the final channel filtering result corresponding to the i-th channel is 0.7×R2+0.3×R3.

[0214] In the above scheme, interpolation parameters are obtained by parsing the filtering instruction information, which can precisely control the interpolation processing method of texture data, ensuring that the texture filtering results meet the requirements of the graphics processing pipeline and improve the quality of texture processing. Furthermore, by first determining the interpolation weights based on the interpolation parameters and at least two vertex texture coordinates, and then performing weighted summation processing on the second texture components of each channel, the channel filtering results for each channel can be calculated efficiently, reducing computational complexity and improving processing efficiency.

[0215] After obtaining the channel filtering results corresponding to at least two channels respectively, the channel filtering results corresponding to at least two channels are used as texture filtering results, wherein the texture filtering results are used to determine the texture data applied in the pixel fragment.

[0216] In some embodiments, after obtaining the texture filtering result, a format conversion process is performed on the texture filtering result according to the third data format corresponding to the pixel shader to obtain the texture output result, which is data in the third data format.

[0217] In illustrative terms, when the third data format differs from the second data format, that is, when the data format required by the pixel shader is not the second data format, the texture filtering result is converted from the second data format to the third data format, the converted texture filtering result is used as the texture output result, and the texture output result is input to the pixel shader.

[0218] In the above scheme, by performing format conversion processing on the texture filtering result and converting it into the third data format corresponding to the pixel shader, it can be ensured that the texture output result is consistent with the data format of the subsequent processing flow, avoiding the problem of data format mismatch and improving the efficiency and stability of the entire graphics processing flow.

[0219] In summary, the texture data processing method provided in this application, after acquiring texture data, converts texture data of any format into texture data of a unified format through channel splitting rules and a preset second data format. Then, it performs texture filtering processing on the texture data of the unified format according to the filtering instruction information to obtain the texture filtering result. Since there is no need to pay attention to the format difference of texture data when filtering texture data, it avoids designing different filtering processes for texture data of different formats, thereby improving the texture filtering efficiency of GPU.

[0220] This application can be applied to GPU modeling in GPU development. In the early stages of GPU development, software modeling is needed to abstract the GPU hardware rendering process and simulate the hardware execution process to verify the GPU's functionality and performance. This process not only enables rapid evaluation of GPU design schemes but also provides software developers with a platform for development and verification, thereby improving the parallelism of cross-departmental development and shortening the project's R&D and iteration cycles.

[0221] In GPU modeling, a standardized GPU rendering instruction interface needs to be provided to software developers, and rendering instructions are parsed and executed by simulating the hardware behavior of the GPU Pipeline. The GPU Pipeline is the core of GPU modeling, and its accurate modeling is crucial to the entire process; this process is often referred to as "electronic system-level modeling." As an indispensable component of the GPU Pipeline, the performance and accuracy of the texture processing module have a significant impact on the overall performance of the GPU. The following explanation uses the implementation of the texture processing module as a texture filtering module as an example.

[0222] Regarding the texture filtering module, the core focus of this application is how to process data in a texture image into individual pixel color values ​​within the GPU pipeline through texture filtering. This process primarily relies on a series of interpolation operations and format conversions to generate the final result. To optimize visual effects, interpolation operations include, but are not limited to, bilinear interpolation, trilinear interpolation, anisotropic interpolation, 3D texture interpolation, and max-min interpolation. After format conversion, the interpolation results generate data conforming to the format specified by the shader. Through texture filtering, the smoothness and clarity of the display effect can be significantly improved, while reducing distortion and jagged edges, thereby achieving high-quality image rendering.

[0223] In related technologies, electronic system-level modeling typically employs C++ frameworks such as SystemC, simulating hardware data transmission through data and event interactions between modules; this is known as hardware-based electronic system-level modeling. Hardware-based electronic system-level modeling methods often require attention to numerous hardware design details, including registers and signals, making the model building process complex and time-consuming.

[0224] Based on this, this application provides a texture filtering method that models a texture filtering module within a GPU pipeline software simulation. Firstly, the functionality and performance of the texture filtering module can be verified in advance. Secondly, an efficient development platform is built using a virtual machine to simulate GPU operation, providing environmental support to software developers before hardware design is completed. This approach promotes collaborative development across multiple departments, improving project parallelism and overall development efficiency. The GPU simulated in the virtual machine includes a texture filtering module. This module determines the texture information applied to the pixel segment corresponding to the target texture coordinates through interpolation. Specifically, the texture filtering module uses the distances of multiple texture information points on the texture image to the target texture coordinates, calculates the weights of each texture information point, and obtains an approximate texture information for the target texture coordinates by weighted summation of multiple texture information points. This approximate texture information is the texture information applied to the pixel segment corresponding to the target texture coordinates. In this virtual machine simulation, the texture filtering module avoids many hardware design-related details, focusing instead on the implementation and optimization of core functions. This abstract design simplifies development work and improves program efficiency, providing an efficient and concise solution for software development.

[0225] In other words, compared to related technologies, this application greatly simplifies the construction process of the texture filtering module. It abstracts away the complex design related to GPU hardware details and shields the implementation of circuit-level registers and signals. The texture filtering module only provides software developers with a virtual software platform focused on debugging and verification. This application emphasizes the development efficiency, scalability, and program performance of modeling, rather than precise hardware-level modeling. This approach significantly improves development speed and provides software developers with more efficient tool support. Specifically:

[0226] (1) In related technologies, hardware-based modeling methods contain a large number of redundant modules. For example, sub-modules for interpolation modes and raw sample data acquisition modes are often implemented repeatedly. This repetitive design not only increases the complexity of the model but also leads to the coexistence of multiple modules with highly similar functions, which is detrimental to code readability and maintainability. At the same time, this redundancy also limits the flexibility and scalability of the model, requiring significant modifications when adjusting or adding functions. The texture filtering module design proposed in this application reduces redundant code in the project by clearly defining the interfaces and functions between units in the texture filtering module. This not only improves code readability but also significantly reduces the cost of software expansion and maintenance, and improves the development efficiency of the project.

[0227] (2) In related technologies, due to the high dependence on hardware details, there is a strong coupling between the format processing of texture data and the format processing of single-channel data. This coupling limits the independence of units, so when introducing new texture data formats, it is often necessary to adjust multiple units in the texture filtering module at the same time, which increases the workload of development and maintenance. In addition, this coupling also reduces the reusability of units and brings additional obstacles to the implementation of new features.

[0228] (3) In related technologies, hardware-based modeling methods typically require that the abstraction and optimization of the model be lossless or have controllable losses. This strict constraint is significant for hardware design and verification, but it also introduces limitations in code implementation. For example, the details of hardware behavior must be completely reproduced, which not only increases code complexity but also places higher demands on development efficiency. Furthermore, this strict abstraction method often fails to fully leverage the flexibility of the program, limiting performance optimization and efficiency improvements. This application provides a transaction-based modeling method that enhances the abstraction level of the texture filtering module and simplifies the communication and management processes between units within the texture filtering module. This high-level abstraction design reduces development and maintenance workload while improving program efficiency and optimizing overall performance.

[0229] (4) In related technologies, hardware-based modeling methods, due to their high focus on low-level program details, require developers to handle a large amount of complex hardware-related information during debugging. While this method is important for verifying hardware designs, it lacks real-time, high-level reference information support for software developers. For example, the front-end cannot provide timely feedback on effective information related to actual program behavior, forcing developers to spend extra time and effort analyzing low-level hardware details, thus increasing the difficulty of the debugging process. This situation not only reduces development efficiency but also increases the challenges of cross-departmental collaboration. This application reduces the exposure of details in hardware-based modeling. In addition, a key information logging function is designed for the texture filtering module to help software developers track the program's running dynamics. During debugging, developers can quickly locate problems, significantly reducing debugging difficulty and improving problem-solving efficiency.

[0230] The following is through Figure 8 The texture data processing method provided in this application is described.

[0231] This is illustrative; please refer to it. Figure 8 The diagram illustrates a texture data processing method executed by a texture filtering module, which includes the following units: a filter pipeline unit 801, a raw sample pipeline unit 802, a format table unit 803, a format conversion method poll unit 804, a filter method poll unit 805, and a log unit 806. The method includes the following steps:

[0232] The texture filtering module mainly includes two parallel processing flows: the filtering pipeline and the raw information pipeline.

[0233] ● Filter line

[0234] 1. The filter pipeline unit 801 acquires texture data.

[0235] The filter pipeline unit 801 inputs texture data into the format table unit 803.

[0236] 3. Format table unit 803 acquires four-channel data and their corresponding data formats.

[0237] The format table unit 803 stores a format mapping table (see Table 1 for reference). Taking the first data format corresponding to the texture data as R32G32B32A32_SINT as an example.

[0238] The texture data obtained from filter pipeline unit 801 is divided into four channels using a format mapping table: the red component (R channel), the green component (G channel), the blue component (B channel), and the alpha component (A channel). These are referred to as four-channel data. Furthermore, the format mapping table converts R32G32B32A32_SINT into a 4-channel array {channel_0_format, channel_1_format, channel_2_format, channel_3_format}, where channel_0_format represents the red channel data format (SINT32) for the red component, channel_1_format represents the green channel data format (SINT32) for the green component, channel_2_format represents the blue channel data format (SINT32) for the blue component, and channel_3_format represents the alpha channel data format (SINT32) for the alpha component.

[0239] 4. The filter pipeline unit 801 performs UNORM / SNORM data bit expansion.

[0240] The filter pipeline unit 801 performs UNORM / SNORM data bit extension on the acquired four-channel data, and then inputs it into the format conversion method pool unit 804. For four-channel data, if there is UNORM / SNORM channel data, bit extension is required to improve accuracy, and it is input as UINT / SINT channel data into the format conversion method pool unit 804 for processing. Normalization is only performed when the fixed-point format is finally converted back to the shader-specified format.

[0241] 5. Format Conversion Method: Pool unit 804 converts the channel data format corresponding to the four channels into a fixed-point format.

[0242] The format conversion method pool unit 804 is used to convert between channel data formats and fixed-point formats. For example, it converts the red channel data format (SINT32), green channel data format (SINT32), blue channel data format (SINT32), and transparency channel data format (SINT32) obtained above into fixed-point formats.

[0243] Optionally, the format conversion method pool unit 804 calls the format conversion code according to the channel data format corresponding to the target channel (such as R channel, G channel, B channel, or A channel), and executes the format conversion code to convert the channel data format of the channel data corresponding to the target channel into a fixed-point format. Specifically, for the channel data obtained from the filter pipeline unit 801 that has undergone data bit extension processing, its corresponding channel data format is converted into a fixed-point format.

[0244] After the format conversion method pool unit 804 converts all four channels corresponding to the filter pipeline unit 801, it obtains the channel data in fixed-point format for each of the four channels, hereinafter referred to as the fixed-point format four-channel data. This fixed-point format four-channel data is then input into the filter pipeline unit 801.

[0245] 6. Filter pipeline unit 801 analyzes the required interpolation type and calculates the interpolation weight.

[0246] The filter pipeline unit 801 parses the filter status word (filter indication information) to obtain the required interpolation parameters, then determines the interpolation weight according to the interpolation processing method indicated by the interpolation parameters, and inputs the interpolation weight into the filter method pool unit 805.

[0247] 8. The filtering method uses the pool cell 805 to perform a weighted summation in the fixed-point number domain.

[0248] The filtering method pool unit 805 calls the corresponding interpolation code, executes the interpolation code, and performs weighted summation processing on the four-channel data in fixed-point format according to the interpolation weights to obtain the texture filtering results in fixed-point format corresponding to the four-channel data respectively. Then, the texture filtering results in fixed-point format corresponding to the four-channel data are input into the format conversion method pool unit 804.

[0249] 9. Format Conversion Method: Pool unit 804 converts fixed-point format to shader-specified format.

[0250] The format conversion method pool unit 804 converts the texture filtering results of the fixed-point format corresponding to the four-channel data into the texture filtering results of the shader-specified format corresponding to the four-channel data, and sends the texture filtering results of the shader-specified format corresponding to the four-channel data to the filtering pipeline unit 801.

[0251] When converting from a fixed-point number format back to a shader-specified format of a basic data type (such as INT, FLOAT, etc.), the following two scenarios may occur: (1) Precision loss: When high-precision data (such as 32-bit fixed-point numbers) is converted to low-precision data (such as 16-bit floating-point numbers), the number of available bits is reduced, resulting in the loss of detailed information (i.e., precision loss). To control this precision loss, different rounding methods can be used, such as RTE (Round To Even) and RTZ (Round Toward Zero), to control precision loss. (2) Overflow: When high-range data (such as 16-bit fixed-point numbers) is converted to low-range data (such as 8-bit signed integers), the numerical range exceeds the representation capability of the target type, resulting in overflow. In this case, overflow can be handled by truncating the upper and lower limits, scaling, etc. Truncation of the upper and lower limits means that when overflow occurs, the numerical value is truncated to the upper and lower limits of the target data type; scaling means that before overflow processing, the numerical value can be scaled to fit the range of the target data type.

[0252] To facilitate lossless conversion from primitive data types to fixed-point numbers, conversions between primitive data types will also be achieved using fixed-point numbers as an intermediary. Illustratively, direct conversions between primitive data types may result in precision loss or overflow. In such cases, fixed-point numbers can be used as an intermediate format to achieve lossless conversion between primitive data types. That is: first, the primitive data type is converted to a fixed-point number, and then the fixed-point number is converted to the target primitive data type.

[0253] 10. Packaging output data of filter pipeline unit 801.

[0254] The filtering pipeline unit 801 packages the texture filtering results of the four channels of data into the shader-specified format and inputs them into the log unit 806.

[0255] 12. Log unit 806 prints logs.

[0256] Log unit 806 stores the texture filtering results in the shader-specified format corresponding to the four channels of data obtained from filter pipeline unit 801 as log data.

[0257] 13. The filter pipeline unit 801 sends data to the GPU pipeline.

[0258] The filtering pipeline unit 801 sends the texture filtering results in the shader-specified format corresponding to the four channels of data to the pixel shader in the GPU pipeline.

[0259] ●Original Information Pipeline

[0260] 2. The raw information pipeline unit 802 acquires texture data.

[0261] The raw information pipeline unit 802 inputs texture data into the format table unit 803.

[0262] 3. Format table unit 803 acquires four-channel data and their corresponding data formats.

[0263] The format table unit 803 stores a format mapping table (see Table 1 for reference). Taking the first data format corresponding to the texture data as R32G32B32A32_SINT as an example.

[0264] The texture data obtained from the raw information pipeline unit 802 is divided into four channels using a format mapping table: the red component (R channel), the green component (G channel), the blue component (B channel), and the alpha component (A channel). These are referred to as four-channel data. Furthermore, the format mapping table converts R32G32B32A32_SINT into a 4-channel array {channel_0_format, channel_1_format, channel_2_format, channel_3_format}.

[0265] 5. Format Conversion Method: Pool unit 804 converts the channel data format corresponding to the four channels into a fixed-point format.

[0266] The format conversion method pool unit 804 is used to implement the conversion between channel data format and fixed-point format.

[0267] Optionally, the format conversion method pool unit 804 calls the format conversion code according to the channel data format corresponding to the target channel (such as R channel, G channel, B channel or A channel), and executes the format conversion code to convert the channel data format of the channel data corresponding to the target channel into a fixed-point format.

[0268] After the format conversion method pool unit 804 converts all four channels corresponding to the original information pipeline unit 802, it obtains channel data in fixed-point format for each of the four channels, hereinafter referred to as fixed-point format four-channel data. This fixed-point format four-channel data is then input into the original information pipeline unit 802.

[0269] 7. The raw information pipeline unit 802 parses the shader specification format.

[0270] The raw information pipeline unit 802 acquires format indication information and parses it to obtain the specified format corresponding to the pixel shader; alternatively, the raw information pipeline unit 802 stores raw texture data and parses the data format of the raw texture data as the specified format of the pixel shader. The specified format of the pixel shader is then sent to the format conversion method pool unit 804.

[0271] 9. Format Conversion Method: Pool unit 804 converts fixed-point format to shader-specified format.

[0272] The format conversion method pool unit 804 converts the fixed-point format four-channel data into shader-specified format four-channel data and sends the shader-specified format four-channel data to the raw information pipeline unit 802.

[0273] 11. The raw information pipeline unit 802 packages and outputs data.

[0274] Raw information pipeline unit 802 packages and outputs at least one of the following data to log unit 806:

[0275] Texture data, four-channel data, fixed-point format four-channel data, and shader-specified format four-channel data.

[0276] 12. Log unit 806 prints logs.

[0277] Log unit 806 stores data obtained from raw information pipeline unit 802 as log data.

[0278] In summary, the texture filtering module provided in this application covers a unified implementation of various texture interpolations and format conversion between different basic data types. Texture filtering plays a crucial role in improving pixel rendering quality, reducing aliasing, and ensuring image rendering effects, and is an important module in the GPU pipeline.

[0279] It has the following beneficial effects:

[0280] 1. Low-redundancy code design: This application emphasizes low-redundancy code design, focusing on the uniformity of module interfaces and the similarity between modules to avoid repetitive code writing, especially by independently extracting the Format Table and Format Convert MethodPool. This design improves code readability and reduces software development and maintenance costs.

[0281] 2. Loosely Coupled Software Design: This application fully considers the low coupling between modules during the design process, especially achieving effective isolation between interpolation calculations and data types. The high cohesion and low coupling of the modules not only improve the reusability and portability of the code, but also promote its extensibility.

[0282] 3. Higher level of code abstraction: This application shields a large number of hardware-level details in the design of the GPU texture filtering module, reducing communication and management between modules. This design improves software development efficiency and optimizes program execution efficiency.

[0283] 4. Detailed structural description: This application describes in detail the functions and composition of each unit in the GPU texture filtering module, namely Filter Pipeline, RawSample Pipeline, Filter Method Poll, Format Convert Method Poll, Format Table and Log, and explains the interface of each unit and how they coordinate to achieve texture filtering.

[0284] 5. Log Service: This application fully considers the real-time printing of important logs during module design, outputting the program's running status to the front end so that software developers can track and debug it.

[0285] 6. Simulation Platform: This application also describes a simulation verification platform for the GPU texture filtering module. The texture filtering module provided in this application is integrated into the GPU pipeline and packaged into a GPU module. It is then combined with an ESL (Electronic System Level) model and encapsulated in a virtual machine for use by software developers.

[0286] This is illustrative; please refer to it. Figure 9 It shows a structural block diagram of a texture data processing device, such as Figure 9 As shown, the device 900 includes:

[0287] The data processing unit 910 is used to acquire indication information and texture data in a first data format, wherein the indication information is used to characterize the processing method of the texture data in the graphics processing pipeline;

[0288] The data splitting unit 920 is used to split the texture data based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel.

[0289] The format conversion unit 930 is used to perform format conversion processing on the first texture components corresponding to the at least two channels according to a preset second data format to obtain the second texture components corresponding to the at least two channels, wherein the second texture components are data in the second data format.

[0290] The data processing unit 910 is further configured to process the second texture components corresponding to the at least two channels respectively based on the processing method indicated by the indication information, and obtain the texture processing result.

[0291] In some embodiments, the data splitting unit 920 is used to determine the channel splitting rule corresponding to the first data format through a format mapping relationship, wherein the format mapping relationship represents the mapping relationship between the data format and the channel splitting rule.

[0292] In some embodiments, the channel splitting rule corresponding to the first data format is used to split the texture data into a first channel corresponding to the first channel data format, a second channel corresponding to the second channel data format, a third channel corresponding to the third channel data format, and a fourth channel corresponding to the fourth data channel format. The first channel, the second channel, the third channel, and the fourth channel are used to store different texture information corresponding to the texture data. The data splitting unit 920 is used to split the texture data based on the channel splitting rule corresponding to the first data format to obtain a first texture component corresponding to the first channel, a first texture component corresponding to the second channel, a first texture component corresponding to the third channel, and a first texture component corresponding to the fourth channel.

[0293] In some embodiments, the second data format includes a fixed-point number format; the data processing unit 910 is further configured to process the second texture components corresponding to the at least two channels respectively in the fixed-point number field based on the processing method indicated by the indication information, to obtain the texture processing result, wherein the fixed-point number field is used to characterize data processing and data representation using the fixed-point number format.

[0294] In some embodiments, the texture processing result includes a texture filtering result; the indication information includes filtering indication information, which is used to perform texture filtering processing on the texture data in the graphics processing pipeline; the data processing unit 910 is further used to perform texture filtering processing on the second texture components corresponding to the at least two channels based on the filtering indication information to obtain the texture filtering result.

[0295] In some embodiments, the texture data includes a texture image corresponding to a pixel fragment; the data processing unit 910 is further configured to parse the filtering instruction information to obtain interpolation parameters and target texture coordinates, wherein the interpolation parameters characterize the interpolation processing method of the texture data, and the target texture coordinates indicate the sampling position of the pixel fragment in the texture image; determine at least two texture coordinates in the texture image according to the interpolation parameters and the target texture coordinates; determine the interpolation weights corresponding to the at least two texture coordinates according to the interpolation parameters and the target distance; the target distance refers to the distance between the target texture coordinates and the texture coordinates; perform weighted summation processing on the second texture component of the i-th channel corresponding to the at least two texture coordinates based on the interpolation weights corresponding to the at least two texture coordinates to obtain the channel filtering result corresponding to the i-th channel, where i is a positive integer and the value of i is from 1 to N, and N represents the number of channels of at least two channels; and use the channel filtering results corresponding to the at least two channels as the texture filtering result.

[0296] In some embodiments, the format conversion unit 930 is configured to perform format conversion processing on the texture filtering result according to the third data format corresponding to the pixel shader to obtain a texture output result, wherein the texture output result is data in the third data format.

[0297] In some embodiments, the texture processing result includes a texture decoding result; the indication information includes decoding indication information, which is used to perform decoding processing on the texture data in the graphics processing pipeline; the data processing unit 910 is further used to perform decoding processing on the second texture components corresponding to the at least two channels based on the decoding indication information to obtain the texture decoding result.

[0298] In some embodiments, the data processing unit 910 is further configured to acquire compressed texture data; acquire the decoding indication information; and perform decompression processing on the compressed texture data to obtain texture data in the first data format.

[0299] In some embodiments, the data processing unit 910 is further configured to parse the decoding indication information to obtain color space conversion parameters and gamma correction parameters; perform color space conversion processing on the second texture components corresponding to the at least two channels according to the color space conversion parameters to obtain the third texture components corresponding to the at least two channels respectively; and perform gamma correction processing on the third texture components corresponding to the at least two channels according to the gamma correction parameters to obtain the texture decoding result.

[0300] In summary, this application provides a texture data processing device, including a data processing unit, a data splitting unit, and a format conversion unit. By designing the data splitting unit and the format conversion unit, texture data in any format (such as a first data format) is converted into texture data in a unified format (i.e., a second data format), reducing the dependence of the data processing unit on the data format of the texture data. In other words, developers do not need to design different data processing units for different data formats, reducing code redundancy during modeling. Furthermore, the data splitting unit splits the texture data into at least two texture components through channel splitting rules. After splitting, the data conversion logic complexity of the data conversion unit is reduced, further reducing the design complexity of the data processing unit. On the other hand, the various units in the texture data processing device modeled in this application abstract away the complex design related to hardware details. The design focus of the texture data processing device is on the abstract implementation of the core functions of each unit, thereby reducing communication and management between units and improving the development efficiency of the GPU.

[0301] In some embodiments, the texture data processing apparatus provided in this application includes at least one of a texture decoding module and a texture filtering module. The following description uses a texture filtering module as an example. Optionally, the texture processing result includes a texture filtering result; the indication information includes filtering indication information, which is used to perform texture filtering processing on the texture data in the graphics processing pipeline; the texture data includes texture images corresponding to pixel segments.

[0302] This is illustrative; please refer to it. Figure 10 It shows a structural block diagram of a texture filtering module.

[0303] like Figure 10 As shown, the texture filtering module includes a filtering pipeline unit 1001, a raw information pipeline unit 1002, a format table unit 1003, a format conversion method pool unit 1004, a filtering method pool unit 1005, and a log unit 1006. The format table unit 1003 is also the aforementioned data splitting unit 920, the format conversion method pool unit 1004 is also the aforementioned format conversion unit 930, and the aforementioned data processing unit 910 includes the filtering pipeline unit 1001 and the filtering method pool unit 1005.

[0304] Optionally, the texture filtering module mainly includes two parallel processing flows: a filtering pipeline and a raw information pipeline.

[0305] (1) Filter pipeline

[0306] The filter pipeline unit 1001 is used to acquire the filter instruction information and texture data in the first data format.

[0307] The format table unit 1003 is used to obtain the texture data from the filtering pipeline unit 1001; and split the texture data based on the channel splitting rule corresponding to the first data format to obtain first texture components corresponding to at least two channels respectively. In some embodiments, if the first texture components corresponding to at least two channels respectively include first texture components of a target data format (such as UNORM / SNORM), the format table unit 1003 is used to send the first texture components corresponding to at least two channels respectively to the filtering pipeline unit 1001, and the filtering pipeline unit 1001 is used to perform data bit extension on the first texture components of the target data format, and to send the first texture components corresponding to at least two channels respectively after performing data bit extension to the format conversion method pool unit 1004.

[0308] The format conversion method pool unit 1004 is used to perform format conversion processing on the first texture components corresponding to the at least two channels according to a preset second data format to obtain the second texture components corresponding to the at least two channels, wherein the second texture components are data in the second data format.

[0309] The filtering method pool unit 1005 is used to perform texture filtering processing on the second texture components corresponding to the at least two channels respectively based on the filtering instruction information to obtain texture filtering results. Optionally, the second data format includes a fixed-point number format; the filtering method pool unit 1005 is used to perform texture filtering processing on the second texture components corresponding to the at least two channels respectively in the fixed-point number domain based on the filtering instruction information to obtain the texture filtering results.

[0310] In some embodiments, the filtering pipeline unit 1001 is used to parse the filtering instruction information to obtain interpolation parameters and target texture coordinates. The interpolation parameters are used to characterize the interpolation processing method of the texture data, and the target texture coordinates are used to indicate the sampling position of the pixel fragment in the texture image. Based on the interpolation parameters and the target texture coordinates, at least two texture coordinates are determined in the texture image. Based on the interpolation parameters and the target distance, the interpolation weights corresponding to the at least two texture coordinates are determined respectively. The target distance refers to the distance between the target texture coordinates and the texture coordinates. The filtering method pool unit 1005 is used to perform weighted summation processing on the second texture component of the i-th channel corresponding to the at least two texture coordinates based on the interpolation weights corresponding to the at least two texture coordinates respectively, to obtain the channel filtering result corresponding to the i-th channel, where i is a positive integer and the value of i is from 1 to N, and N represents the number of channels of at least two channels. The channel filtering results corresponding to the at least two channels are used as the texture filtering result.

[0311] Optionally, the format conversion unit 1003 is further configured to perform format conversion processing on the texture filtering result according to the third data format corresponding to the pixel shader to obtain a texture output result, wherein the texture output result is data in the third data format.

[0312] Optionally, the filtering pipeline unit 1001 is further configured to acquire the texture output result of the third data format and send the texture output result to the log unit 1006; the log unit 1006 is configured to store the texture output result of the third data format as log data.

[0313] In some embodiments, the log unit 1006 is used to send log data to the filter pipeline unit 1001. Schematic, the log unit 1006 is used to send texture output results in a third data format to the filter pipeline unit 1001, and the filter pipeline unit 1001 is used to input the texture output results in the third data format to the pixel shader.

[0314] (2) Original information pipeline

[0315] The raw information pipeline unit 1002 is used to acquire texture data in a first data format.

[0316] The format table unit 1003 is used to obtain the texture data from the original information pipeline unit 1002; and to split the texture data based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel.

[0317] The format conversion method pool unit 1004 is used to perform format conversion processing on the first texture components corresponding to the at least two channels according to a preset second data format to obtain the second texture components corresponding to the at least two channels, wherein the second texture components are data in the second data format.

[0318] The raw information pipeline unit 1002 is also used to obtain the third data format corresponding to the pixel shader. Schematic, the raw information pipeline unit 1002 parses the texture data of the first data format and uses the first data format as the third data format, or the raw information pipeline unit 1002 obtains shader format indication information and parses the data format in the shader format indication information as the third data format.

[0319] The format conversion method pool unit 1004 is used to perform format conversion processing on the second texture components corresponding to the at least two channels according to the third data format corresponding to the pixel shader, so as to obtain the fourth texture components corresponding to the at least two channels, wherein the fourth texture components are data of the third data format.

[0320] Optionally, the raw information pipeline unit 1002 is used to acquire the fourth texture components corresponding to the at least two channels respectively, and to send the fourth texture components corresponding to the at least two channels respectively to the log unit 1006; the log unit 1006 is used to store the fourth texture components corresponding to the at least two channels as log data.

[0321] It should be noted that the specific limitations of the one or more texture data processing devices (such as texture filtering modules) provided above can be found in the limitations of the texture data processing methods above, and will not be repeated here. Each module (unit) of the above-mentioned device can be implemented entirely or partially by software, hardware, or a combination thereof. Each module can be embedded in the processor of the computer device in hardware form or independent of the processor of the computer device, or it can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0322] This application also provides a computer device, which includes: a processor and a memory, wherein the memory stores a computer program; the processor is used to execute the computer program in the memory to implement the texture data processing method provided in the above-described method embodiments.

[0323] For example, Figure 11 This is a structural block diagram of a computer device 1100 provided in an exemplary embodiment of this application. Optionally, the computer device 1100 is a server 1100.

[0324] Typically, server 1100 includes a processor 1101 and memory 1102.

[0325] Processor 1101 may include one or more processing cores, such as a quad-core processor, an eleven-core processor, etc. Processor 1101 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1101 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1101 may integrate a GPU, which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1101 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0326] The memory 1102 may include one or more computer-readable storage media, which may be non-transitory. The memory 1102 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1102 are used to store at least one instruction, which is executed by the processor 1101 to implement the texture data processing methods provided in the various method embodiments of this application.

[0327] In some embodiments, server 1100 may optionally include an input interface 1103 and an output interface 1104. Processor 1101, memory 1102, and input interface 1103 and output interface 1104 can be connected via a bus or signal lines. Various peripheral devices can be connected to input interface 1103 and output interface 1104 via a bus, signal lines, or circuit board. Input interface 1103 and output interface 1104 can be used to connect at least one input / output (I / O) related peripheral device to processor 1101 and memory 1102. In some embodiments, processor 1101, memory 1102, and input interface 1103 and output interface 1104 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1101, memory 1102, and input interface 1103 and output interface 1104 can be implemented on separate chips or circuit boards, and this application embodiment does not limit this.

[0328] Those skilled in the art will understand that Figure 11 The structure shown does not constitute a limitation on the computer device 1100 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0329] In an exemplary embodiment, this application provides a chip including programmable logic circuits and / or program instructions, which, when run on a computer device, are used to implement the texture data processing methods provided in the above-described method embodiments.

[0330] In an exemplary embodiment, this application provides a computer-readable storage medium storing a computer program that is loaded and executed by a processor to implement the texture data processing methods provided in the above-described method embodiments.

[0331] In an exemplary embodiment, this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the processor of the computer device to load and execute the texture data processing method provided in the above-described method embodiments.

[0332] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0333] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0334] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0335] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A texture data processing method, characterized in that, The method includes: Acquire instruction information and texture data in a first data format, wherein the instruction information is used to characterize the processing method of the texture data in the graphics processing pipeline; and the texture data is used to describe the appearance features of the object surface. The texture data is split according to the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel; According to a preset second data format, the first texture components corresponding to the at least two channels are subjected to format conversion processing to obtain the second texture components corresponding to the at least two channels, wherein the second texture components are data in the second data format; Based on the processing method indicated by the indication information, the second texture components corresponding to the at least two channels are processed to obtain the processing results corresponding to the at least two channels as texture processing results.

2. The method according to claim 1, characterized in that, Before splitting the texture data based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel, the method further includes: The channel splitting rule corresponding to the first data format is determined by the format mapping relationship, which represents the mapping relationship between the data format and the channel splitting rule.

3. The method according to claim 1, characterized in that, The channel splitting rule corresponding to the first data format is used to split the texture data into a first channel corresponding to the first channel data format, a second channel corresponding to the second channel data format, a third channel corresponding to the third channel data format, and a fourth channel corresponding to the fourth data channel format. The first channel, the second channel, the third channel, and the fourth channel are used to store different texture information corresponding to the texture data. The step of splitting the texture data based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel includes: The texture data is split based on the channel splitting rules corresponding to the first data format to obtain the first texture component corresponding to the first channel, the first texture component corresponding to the second channel, the first texture component corresponding to the third channel, and the first texture component corresponding to the fourth channel.

4. The method according to any one of claims 1 to 3, characterized in that, The second data format includes fixed-point number format; The processing method based on the indication information processes the second texture components corresponding to the at least two channels respectively, and obtains the processing results corresponding to the at least two channels as texture processing results, including: The second texture components corresponding to the at least two channels are processed in the fixed-point number field according to the processing method indicated by the indication information to obtain the processed second texture components corresponding to the at least two channels respectively. The fixed-point number field is used to characterize the data processing and data representation using the fixed-point number format.

5. The method according to any one of claims 1 to 3, characterized in that, The texture processing result includes a texture filtering result; the indication information includes filtering indication information, which is used to perform texture filtering processing on the texture data in the graphics processing pipeline. The processing method indicated by the indication information processes the second texture components corresponding to the at least two channels respectively to obtain texture processing results, including: Based on the filtering instruction information, texture filtering processing is performed on the second texture components corresponding to the at least two channels respectively, and the channel filtering results corresponding to the at least two channels are used as the texture filtering results.

6. The method according to claim 5, characterized in that, The texture data includes texture images corresponding to pixel fragments; The process of processing the second texture components corresponding to the at least two channels based on the texture filtering method indicated by the filtering indication information, and obtaining the channel filtering results corresponding to the at least two channels as the texture filtering results, includes: The interpolation parameters and target texture coordinates are obtained by parsing the filtering indication information. The interpolation parameters are used to characterize the interpolation processing method of the texture data, and the target texture coordinates are used to indicate the sampling position of the pixel fragment in the texture image. Based on the interpolation parameters and the target texture coordinates, at least two texture coordinates are determined in the texture image; Based on the interpolation parameters and the target distance, the interpolation weights corresponding to the at least two texture coordinates are determined respectively; the target distance refers to the distance between the target texture coordinates and the texture coordinates. Based on the interpolation weights corresponding to the at least two texture coordinates, a weighted summation process is performed on the second texture component of the i-th channel corresponding to the at least two texture coordinates to obtain the channel filtering result corresponding to the i-th channel, where i is a positive integer and the value of i is from 1 to N, and N represents the number of channels of the at least two channels; The channel filtering results corresponding to the at least two channels are used as the texture filtering results.

7. The method according to claim 5, characterized in that, After processing the second texture components corresponding to the at least two channels according to the texture filtering method indicated by the filtering indication information, and obtaining the channel filtering results corresponding to the at least two channels as the texture filtering results, the method further includes: The texture filtering result is converted according to the third data format corresponding to the pixel shader to obtain the texture output result, which is the data in the third data format.

8. The method according to any one of claims 1 to 3, characterized in that, The texture processing result includes a texture decoding result; the indication information includes decoding indication information, which is used to perform decoding processing on the texture data in the graphics processing pipeline; The processing method based on the indication information processes the second texture components corresponding to the at least two channels respectively, and obtains the processing results corresponding to the at least two channels as texture processing results, including: Based on the decoding indication information, the second texture components corresponding to the at least two channels are decoded to obtain the processing results corresponding to the at least two channels as the texture decoding results.

9. The method according to claim 8, characterized in that, Before acquiring the indication information and the texture data in the first data format, the method further includes: Obtain the compressed texture data; The acquisition of indication information and texture data in the first data format includes: Obtain the decoding indication information; The compressed texture data is decompressed to obtain texture data in the first data format.

10. The method according to claim 8, characterized in that, The texture decoding method based on the decoding indication information processes the second texture components corresponding to the at least two channels respectively, and obtains the processing results corresponding to the at least two channels as the texture decoding results, including: The color space conversion parameters and gamma correction parameters are obtained by parsing the decoding indication information; According to the color space conversion parameters, perform color space conversion processing on the second texture components corresponding to the at least two channels respectively to obtain the third texture components corresponding to the at least two channels respectively; Gamma correction processing is performed on the third texture components corresponding to the at least two channels according to the gamma correction parameters, and the processing results corresponding to the at least two channels are used as the texture decoding results.

11. A texture data processing apparatus, characterized in that, The device includes: A data processing unit is used to acquire indication information and texture data in a first data format, wherein the indication information is used to characterize the processing method of the texture data in the graphics processing pipeline; and the texture data is used to describe the appearance features of an object surface. The data splitting unit is used to split the texture data based on the channel splitting rules corresponding to the first data format to obtain at least two first texture components corresponding to each channel. The format conversion unit is used to perform format conversion processing on the first texture components corresponding to the at least two channels according to a preset second data format to obtain the second texture components corresponding to the at least two channels, wherein the second texture components are data in the second data format. The data processing unit is further configured to process the second texture components corresponding to the at least two channels respectively based on the processing method indicated by the indication information, and obtain the processing results corresponding to the at least two channels respectively as texture processing results.

12. The apparatus according to claim 11, characterized in that, The texture processing result includes a texture filtering result; the indication information includes filtering indication information, which is used to perform texture filtering processing on the texture data in the graphics processing pipeline; the texture data includes texture images corresponding to pixel fragments. The data processing unit further includes: A filtering pipeline unit is used to parse the filtering instruction information to obtain interpolation parameters and target texture coordinates. The interpolation parameters characterize the interpolation processing method of the texture data, and the target texture coordinates indicate the sampling position of the pixel fragment in the texture image. Based on the interpolation parameters and the target texture coordinates, at least two texture coordinates are determined in the texture image. Based on the interpolation parameters and the target distance, the interpolation weights corresponding to the at least two texture coordinates are determined. The target distance refers to the distance between the target texture coordinates and the texture coordinates. The filtering method pool unit is used to perform weighted summation processing on the second texture component of the i-th channel corresponding to the at least two texture coordinates based on the interpolation weights corresponding to the at least two texture coordinates respectively, to obtain the channel filtering result corresponding to the i-th channel, where i is a positive integer and the value of i is from 1 to N, and N represents the number of channels of the at least two channels; the channel filtering result corresponding to the at least two channels is used as the texture filtering result.

13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, which is loaded and executed by the processor to implement the texture data processing method as described in any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that, The storage medium stores at least one program segment, which is loaded and executed by a processor to implement the texture data processing method as described in any one of claims 1 to 10.

15. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the texture data processing method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • GPU multi-thread texture mapping SystemC modeling structure

    CN106683171A

  • Texture coordinate processing method and device, electronic equipment and storage medium

    CN120510266A