Texture processing device, electronic device, texture request processing method

CN122820944APending Publication Date: 2026-09-25MOORE THREADS TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611236329.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-14
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

纹理处理器对每个纹理请求都进行独立的采样操作,造成计算资源浪费以及功耗开销显著增加

Benefits of technology

[0011]应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122820944A_ABST
    Figure CN122820944A_ABST
Patent Text Reader

Abstract

The present disclosure provides a texture processing device, an electronic device and a texture request processing method. The device comprises a gradient merging unit and a detail level calculation unit connected in series. The gradient merging unit is configured to, in the case of receiving a plurality of initial texture requests in a current batch, divide the plurality of initial texture requests into first texture requests and second texture requests according to the gradients of the initial texture requests. The gradients of different first texture requests are different, and there is a first texture request with the same gradient for each second texture request. The detail level calculation unit is configured to, for each first texture request, determine the detail level of the first texture request according to the gradient of the first texture request, and in the case of there being a second texture request with the same gradient as the first texture request, determine the detail level of the first texture request as the detail level of the second texture request with the same gradient. According to the embodiments of the present disclosure, the calculation resources can be saved and the power consumption can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of graphics processing technology, and in particular to a texture processing apparatus, electronic device, and texture request processing method. Background Technology

[0002] The Texture Processor Unit (TPU) is a dedicated hardware subsystem within the Graphics Processing Unit (GPU) that is responsible for texture sampling, address calculation, filtering and interpolation, Level of Detail (LOD), and texture cache access.

[0003] In related technologies, shaders send a set of texture requests to the texture processor at a time. The texture processor performs independent sampling operations on each texture request, resulting in wasted computing resources and a significant increase in power consumption. Summary of the Invention

[0004] This disclosure provides a texture processing apparatus, an electronic device, and a texture request processing method.

[0005] In a first aspect, this disclosure provides a texture processing apparatus, including a gradient merging unit and a level of detail (LMD) calculation unit, wherein the gradient merging unit is connected to the LMD calculation unit; the gradient merging unit is configured to: upon receiving multiple initial texture requests in the current batch, divide the multiple initial texture requests into first texture requests and second texture requests according to the gradient of each initial texture request; wherein the gradients of different first texture requests are different, and each second texture request has a first texture request with the same gradient; the LMD calculation unit is configured to: for each first texture request, determine the level of detail of the first texture request according to the gradient of the first texture request, and, if there is a second texture request with the same gradient as the first texture request, determine the level of detail of the first texture request as the level of detail of the second texture request with the same gradient.

[0006] In a second aspect, this disclosure provides an electronic device including a coloring device and a texture processing device of the first aspect, wherein the coloring device is configured to send an initial texture request to the texture processing device.

[0007] Thirdly, this disclosure provides a texture request processing method applied to a gradient merging unit of a texture processing apparatus, the texture processing apparatus further comprising a level of detail calculation unit connected to the gradient merging unit; the method comprising: upon receiving multiple initial texture requests in the current batch, dividing the multiple initial texture requests into a first texture request and a second texture request according to the gradient of each initial texture request; wherein different first texture requests have different gradients, and each second texture request has a first texture request with the same gradient; sending the first texture request to the level of detail calculation unit, so that the level of detail calculation unit determines the level of detail of the first texture request based on the gradient of the first texture request, and in the case of a second texture request with the same gradient as the first texture request, determining the level of detail of the first texture request as the level of detail of the second texture request with the same gradient.

[0008] Fourthly, this disclosure provides a texture request processing method applied to a detail level calculation unit of a texture processing apparatus, the texture processing apparatus further comprising a gradient merging unit connected to the detail level calculation unit; the method comprising: receiving a first texture request from the gradient merging unit; for each first texture request, determining the detail level of the first texture request based on the gradient of the first texture request; and, if a second texture request with the same gradient as the first texture request exists, determining the detail level of the first texture request as the detail level of the second texture request with the same gradient; wherein the first texture request and the second texture request are obtained by gradient partitioning of multiple initial texture requests in the current processing batch; wherein different first texture requests have different gradients, and each second texture request has a first texture request with the same gradient.

[0009] Fifthly, this disclosure provides a texture request processing method applied to a texture processing apparatus. The method includes: upon receiving multiple initial texture requests in the current batch, dividing the multiple initial texture requests into first texture requests and second texture requests based on the gradient of each initial texture request; wherein different first texture requests have different gradients, and each second texture request has a first texture request with the same gradient; for each first texture request, determining the level of detail of the first texture request based on the gradient of the first texture request, and if a second texture request with the same gradient as the first texture request exists, determining the level of detail of the first texture request as the level of detail of the second texture request with the same gradient.

[0010] The embodiments provided in this disclosure offer a texture processing apparatus, including a gradient merging unit and a level-of-detail (LOD) calculation unit connected together. The gradient merging unit is configured to, upon receiving multiple initial texture requests in the current batch, divide the multiple initial texture requests into first texture requests and second texture requests based on the gradients of each initial texture request. Different first texture requests have different gradients, and each second texture request contains first texture requests with the same gradient. The level-of-detail calculation unit is configured to determine the level of detail for each first texture request based on its gradient, and directly use the level of detail of each first texture request as the level of detail of the second texture request with the same gradient. In this way, by identifying and merging initial texture requests with the same gradient, only one level-of-detail calculation is performed for each initial texture request with the same gradient, instead of performing level-of-detail calculations separately for each initial texture request with the same gradient. This eliminates the repetitive calculation process, saves computational resources, and effectively reduces power consumption. Simultaneously, by synchronizing the level of detail of one initial texture request to other initial texture requests with the same gradient, the level of detail of multiple initial texture requests is obtained in parallel without increasing the area of ​​the LOD calculation unit, balancing area and parallelism, improving system energy efficiency, and overcoming system bottleneck limitations.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:

[0013] Figure 1 This is a block diagram of a texture processing apparatus provided in an embodiment of the present disclosure.

[0014] Figure 2 This is a block diagram of an electronic device provided in an embodiment of the present disclosure.

[0015] Figure 3 This is a block diagram of an electronic device provided in an embodiment of the present disclosure.

[0016] Figure 4 This is a flowchart of a texture processing method provided in an embodiment of the present disclosure.

[0017] Figure 5 This is a flowchart of a texture processing method provided in an embodiment of the present disclosure.

[0018] Figure 6 This is a flowchart of a texture processing method provided in an embodiment of the present disclosure. Detailed Implementation

[0019] To enable those skilled in the art to better understand the technical solutions of this disclosure, exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of this disclosure to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0020] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.

[0021] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.

[0022] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Words such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.

[0023] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.

[0024] A pixel is the smallest discrete sampling point on a display screen or rendering target, while a texel is the smallest discrete storage unit within a texture map. In texture sampling, the gradient is the partial derivative of the pixel coordinates in screen space, describing the ratio of change between pixels and texels. The larger the gradient, the more texels a pixel covers, meaning the texture is compressed; the smaller the gradient, the less texture a pixel covers, meaning the texture is stretched.

[0025] In a 2D texture coordinate system, the u-axis represents the horizontal direction, corresponding to the left and right sides of the image; the v-axis represents the vertical direction, corresponding to the up and down sides of the image. The gradient includes four dimensions: dudx, dudy, dvdx, and dvdy. Here, dudx represents the change from pixel (x, y) to pixel (x+1, y) along the u-axis; dudy represents the change from pixel (x, y) to pixel (x, y+1) along the u-axis; dvdx represents the change from pixel (x, y) to pixel (x+1, y) along the v-axis; and dvdy represents the change from pixel (x, y) to pixel (x, y+1) along the v-axis. A 3D texture coordinate system adds an s-axis representing the depth direction to the 2D texture coordinate system. Correspondingly, the gradient adds two dimensions: dsdx and dsdy. Here, dsdx represents the change from pixel (x, y) to pixel (x+1, y) along the s-axis, and dsdy represents the change from pixel (x, y) to pixel (x, y+1) along the s-axis.

[0026] LOD (Level of Detail) describes texture detail. The LOD level indicates which mipmap layer should be used for a pixel on the current display screen. Mipmaps are multi-level textures generated by repeatedly halving the width and height of a single texture and storing them in memory, significantly reducing rendering load. Generally, the closer an object is to the camera, the smaller the LOD level, the higher the texture resolution, the fewer texels are used, and the less memory communication. Conversely, the farther an object is from the camera, the larger the LOD level, the lower the texture resolution, and the blurrier it becomes, but the more texels are used. Without LOD, there would be more memory communication, potentially requiring many texels to be sampled and filtered to generate a single pixel in the final image. With LOD, only the texture of the current mipmap layer needs to be used, instead of loading the entire texture.

[0027] The gradient determines the level of detail (LOD), which is the quantization result of the gradient. Hardware can map continuous gradient changes to discrete LOD levels.

[0028] A shader can send a texture request to the Texture Processor Unit (TPU). The texture processor can obtain state parameters and pixel coordinates from the texture request, convert the pixel coordinates into texel coordinates, calculate the Level of Detail (LOD) based on the gradient in the state parameters, determine the memory address by combining the texel coordinates and LOD, read the texels from the memory address, filter the texels, and then send the result back to the shader.

[0029] In related technologies, shaders send a group of texture requests to a texture processor at once. The texture processor performs an independent sampling operation on each texture request. For texture requests with identical gradients, the texture processor repeatedly performs the same calculation for the same texture. However, gradients have many parameters and require high accuracy in LOD calculations; this repetitive calculation leads to wasted computational resources and a significant increase in power consumption.

[0030] Furthermore, since a single LOD calculation unit in a texture processor can only process the gradient of one pixel per clock cycle and ultimately output the LOD of that pixel, when there are N pixels, it takes N clock cycles to output the LOD of N pixels. In related technologies, if the LOD level calculation of multiple pixels is to be processed simultaneously, more LOD calculation units need to be arranged, doubling the area overhead; if the area is to be reduced, it is necessary to wait for each pixel to be calculated sequentially, which cannot fully utilize the parallel processing capability of the system, thus creating a performance bottleneck; it is clear that it is impossible to balance area and parallelism.

[0031] The texture processing apparatus according to an embodiment of this disclosure includes a gradient merging unit and a level-of-detail (LOD) calculation unit connected together. The gradient merging unit is configured to, upon receiving multiple initial texture requests in the current batch, divide the multiple initial texture requests into first texture requests and second texture requests based on the gradients of each initial texture request. The gradients of different first texture requests are different, and each second texture request contains first texture requests with the same gradient. The level-of-detail calculation unit is configured to determine the level of detail for each first texture request based on its gradient, and directly use the level of detail of each first texture request as the level of detail of the second texture request with the same gradient. In this way, by identifying and merging initial texture requests with the same gradient, only one level-of-detail calculation is performed for initial texture requests with the same gradient, instead of performing level-of-detail calculations separately for each initial texture request with the same gradient. This eliminates the repetitive calculation process, saves computational resources, and effectively reduces power consumption. Simultaneously, by synchronizing the level of detail of one initial texture request to other initial texture requests with the same gradient, the level of detail of multiple initial texture requests is obtained in parallel without increasing the area of ​​the LOD calculation unit, balancing area and parallelism, improving system energy efficiency, and overcoming system bottleneck limitations.

[0032] Figure 1 This is a block diagram of a texture processing apparatus provided in an embodiment of the present disclosure. (Refer to...) Figure 1 The texture processing device 10 includes a gradient merging unit 101 and a detail level calculation unit 102.

[0033] Both the gradient merging unit 101 and the level of detail (LLD) calculation unit 102 are hardware processing units within the texture processing device 10. Unlike software computation modules, they do not require the CPU's general computing power; instead, they rely on hardware logic circuits to complete the entire hardware-accelerated process of gradient comparison, request merging, and LLD calculation of texture requests. In one example, the gradient merging unit 101 and the LLD calculation unit 102 can be any of the following hardware logic structures: Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), or GPU built-in hardware IP core. The gradient merging unit 101 and the LLD calculation unit 102 can be customized and adapted to the chip's fabrication process and computing power requirements.

[0034] The gradient merging unit 101 and the level-of-details computation unit 102 are connected. A hardware communication connection can be established between the gradient merging unit 101 and the level-of-details computation unit 102. In one example, they can exchange data via an on-chip high-speed data bus, a hardware register interaction link, or an on-chip parallel data transmission interface.

[0035] The gradient merging unit 101 is configured to: upon receiving multiple initial texture requests in the current batch, divide the multiple initial texture requests into first texture requests and second texture requests according to the gradient of each initial texture request; wherein, different first texture requests have different gradients, and each second texture request contains first texture requests with the same gradient.

[0036] An initial texture request can represent a texture request sent by the shader to the graphics processing unit. An initial texture request is an undivided texture request. The shader sends a group of texture requests to the texture processor at a time. This group of texture requests can be considered a batch of texture requests.

[0037] After receiving multiple initial texture requests for the current batch from the shading unit, the texture sampling device can extract the pixel coordinates and state parameters of each initial texture request. In gradient mode, the state parameters include the gradient. Therefore, the texture sampling device can extract the gradient of each initial texture request in the current batch.

[0038] After extracting the gradients of each initial texture request, the gradient merging unit divides each initial texture request into two categories: first texture requests and second texture requests. The gradients of each pair of first texture requests are distinct; any second texture request can be matched with a first texture request whose gradient is identical.

[0039] The first texture request's level of detail calculation requires hardware computing power to perform gradient-based computation. The second texture request can reuse the level of detail from the first texture request, which has the same gradient, without requiring hardware computing power for gradient-based computation.

[0040] In one example, the gradient merging unit can compare the gradients of each initial texture request pairwise, and then determine the first texture request and the second texture request based on the comparison results.

[0041] The detail level calculation unit 102 is configured to: for each first texture request, determine the detail level of the first texture request based on the gradient of the first texture request, and if there is a second texture request with the same gradient as the first texture request, determine the detail level of the first texture request as the detail level of the second texture request.

[0042] For each first texture request within the current batch, the level of detail (LMD) computation unit can determine its LMD based on its gradient. The process of determining the LMD based on the gradient can refer to relevant techniques. For example, after obtaining the gradient, the LMD computation unit can calculate the texture change magnitude in the x and y directions respectively, take the maximum value of the texture change magnitude as the maximum texture change span, and use a base-2 logarithm to calculate the LMD on the maximum texture change span.

[0043] For each first texture request in the current batch, there may be a second texture request with the same gradient, or there may be no second texture request with the same gradient (i.e., the gradient of the first texture request is unique). Therefore, if a second texture request with the same gradient exists, the level-of-details calculation unit can directly use the level-of-details of the first texture request as the level-of-details of the second texture request, thereby saving hardware computing resources. If no second texture request with the same gradient exists, the level-of-details calculation unit does not need to further process the level-of-details of the first texture request.

[0044] It should be understood that since each second texture request has a first texture request with the same gradient, the detail level calculation unit completes the detail level calculation of all first texture requests while simultaneously synchronizing the detail level of all second texture requests.

[0045] In some possible implementations, the gradient merging unit can send a first texture request to the level-of-details (LLD) computation unit, but not a second texture request. Simultaneously with sending the first texture request, it sends merging information corresponding to that first texture request, indicating a second texture request with the same gradient as the first texture request. After receiving the first texture request, the LLD computation unit can calculate the level of detail based on its gradient, determine the corresponding second texture request based on the merging information, and directly reuse the calculated level of detail for the second texture request. This approach saves both the computational power of the LLD computation unit and the communication resources between the gradient merging unit and the LLD computation unit.

[0046] In some possible implementations, the gradient merging unit may send a first texture request and a second texture request to the level of detail (LMD) unit, and simultaneously send the corresponding merging information. After receiving the first texture request, the LMD unit can calculate the level of detail based on the gradient of the first texture request, and determine the corresponding second texture request based on the merging information. Subsequent receipts of the corresponding second texture request do not require recalculation of the level of detail; instead, the previously calculated level of detail is directly reused.

[0047] In some possible implementations, the gradient merging unit can send a first texture request and a second texture request to the level of detail (LMD) calculation unit, and send information indicating that the first texture request has the same gradient when sending the second texture request. After receiving the first texture request, the LMD calculation unit can calculate the level of detail based on the gradient of the first texture request; after receiving the second texture request, it can find the first texture request with the same gradient based on the aforementioned indication information and reuse the level of detail of the first texture request without recalculating the level of detail.

[0048] In some possible implementations, the gradient merging unit can poll the first texture request of the current batch. In each clock cycle, the gradient merging unit sends the first texture request polled in the current clock cycle, along with its corresponding merging information, to the level of detail (LMD) unit. Upon receiving the first texture request, the LMD unit can determine its level of detail based on its gradient and synchronize this level of detail to the second texture request indicated by the merging information, which has the same gradient as the first texture request.

[0049] It should be noted that the order in which the gradient merging unit polls the first texture request is consistent with the order of the initial texture requests in the current batch.

[0050] For example, the initial texture requests in the current batch include request A, request B, and request C. Request A and request B have the same gradient, while request A and request C have different gradients. The gradient merging unit can determine that request A and request C are the first texture requests, and request B is the second texture request. In its first clock cycle, the gradient merging unit can send request A and its corresponding merging information to the level of detail calculation unit, and in its second clock cycle, it can send request C to the level of detail calculation unit. In its first clock cycle, the level of detail calculation unit can determine the level of detail of request A based on its gradient and use the level of detail of request A as the level of detail of request B; in its second clock cycle, it can determine the level of detail of request C based on its gradient.

[0051] According to the texture processing apparatus of this disclosure, by identifying and merging initial texture requests with the same gradient, it performs only one level-of-detail calculation for each initial texture request with the same gradient, instead of performing level-of-detail calculations separately for each initial texture request with the same gradient. This eliminates the process of repeated calculations, saves computing resources, and effectively reduces power consumption. Simultaneously, by synchronizing the level-of-detail of one initial texture request with other initial texture requests with the same gradient, the level-of-detail of multiple initial texture requests is obtained in parallel without increasing the area of ​​the LOD computing unit. This balances area and parallelism, improves the system's energy efficiency ratio, and overcomes system bottleneck limitations.

[0052] In some embodiments, the gradient merging unit is specifically configured to: divide initial texture requests with the same gradient in the current batch into the same request set; for each request set, determine the target initial texture request in the request set as the first texture request, and determine the other initial texture requests in the request set other than the target initial texture request as the second texture request.

[0053] The gradient merging unit can cluster the initial texture requests in the current batch based on the gradient, so that initial texture requests with the same gradient are grouped into the same request set.

[0054] The gradient merging unit can determine the target initial texture request in each request set as the first texture request. Since the gradients of initial texture requests belonging to different request sets are necessarily different, the gradients of the target initial texture requests in each request set are necessarily different, and thus they can be used as the first initial texture requests.

[0055] The gradient merging unit can identify other initial texture requests in each request set besides the target initial texture request as second texture requests. Since the initial texture requests within a request set have the same gradient, and the target initial texture request is identified as the first texture request, all other initial texture requests in each request set besides the first initial texture request must have a first texture request with the same gradient, and should be considered as second texture requests.

[0056] It should be understood that a request set may include one or more initial texture requests. In the case where a request set includes an initial texture request, this initial texture request is considered the first texture request. This first texture request does not have a second texture request with the same gradient, and the level of detail of this first texture request does not need to be synchronized.

[0057] In one example, the target initial texture request can be any initial texture request in the set of requests. In another example, the target initial texture request can be the first initial texture request in the set of requests.

[0058] It should be noted that, in the process of the gradient merging unit dividing initial texture requests with the same gradient into the same request set, the order of these initial texture requests in the request set is consistent with the order of each initial texture request in the current batch. That is, the order of these initial texture requests in the request set is consistent with the order of these initial texture requests in the initial texture request data stream.

[0059] For example, the initial texture request data stream includes requests A, B, and C in sequence. Requests A and B have the same gradient, while requests A and C have different gradients. The gradient merging unit can partition requests A and B into the first request set, and request C into the second request set. The first initial texture request appearing in the initial texture request data stream in the first request set (referred to as request A) is identified as the first texture request. The other initial texture requests in the first request set (referred to as request B) are identified as second texture requests. Finally, the first initial texture request appearing in the initial texture request data stream in the second request set (referred to as request C) is identified as the first texture request.

[0060] In some embodiments, in the received initial texture request data stream, the target initial texture request is located before other initial texture requests in the set of requests to which it belongs.

[0061] Multiple initial texture requests in the current batch enter the gradient merging unit in the form of an initial texture request data stream. That is, the initial texture request data stream includes multiple initial texture requests, which are arranged in a certain order and belong to the same batch.

[0062] In the initial texture request data stream, the target initial texture request is located before other initial texture requests in its set. In other words, compared to other initial texture requests within the same request set, the target initial texture request is the first one in the initial texture request data stream.

[0063] As one implementation of this disclosure, the partitioning logic of the first texture request and the second texture request is simplified by using set partitioning and first-end tagging, which reduces the hardware logic complexity of the gradient merging unit, reduces hardware overhead, and improves partitioning efficiency.

[0064] In some embodiments, the gradient merging unit is specifically configured to: traverse the plurality of initial texture requests according to the order of the initial texture requests in the initial texture request data stream; for each traversed initial texture request: if the initial texture request is the first initial texture request in the initial texture request data stream, create a corresponding request set for the initial texture request; if the initial texture request is not the first initial texture request in the initial texture request data stream, if there exists a preceding initial texture request with the same gradient as the initial texture request, add the initial texture request to the request set corresponding to the preceding initial texture request; if there is no preceding initial texture request with the same gradient as the initial texture request, create a corresponding request set for the initial texture request.

[0065] If the initial texture request currently being traversed is the first initial texture request in the initial texture request data stream, it indicates that there is currently no request set. Therefore, a corresponding request set can be created for this initial texture request.

[0066] If the currently traversed initial texture request is not the first initial texture request in the initial texture request data stream, it indicates that a request combination already exists. Therefore, we can first determine whether there is a preceding initial texture request with the same gradient as this initial texture request. If there is a preceding initial texture request with the same gradient as this initial texture request, it indicates that there is a request set corresponding to this initial texture request, and this initial texture request can be added to this request set. If there is no preceding initial texture request with the same gradient as this initial texture request, it indicates that there is no request set corresponding to this initial texture request, and a corresponding request set can be created for this initial texture request.

[0067] In this context, a preceding initial texture request refers to an initial texture request in the current batch that precedes it in the order of the preceding initial texture request. For example, if the initial texture requests in the current batch include request A, request B, and request C, then request A is a preceding initial texture request to request B, and both request A and request B are preceding initial texture requests to request C.

[0068] As one implementation of this disclosure, on the one hand, the request set corresponding to each initial texture request is determined sequentially by traversal, which can avoid missing initial texture requests and improve reliability; on the other hand, only the gradient of the currently traversed initial texture request is compared with the gradient of its predecessor initial texture request, which reduces the number of comparison operations, saves resources, and improves efficiency.

[0069] In some embodiments, the gradient merging unit is further configured to: determine a target first texture request to be sent in the current clock cycle; generate corresponding merging information according to the request set to which the target first texture request belongs, the merging information being used to indicate a target second texture request with the same gradient as the target first texture request; and send the target first texture request and the corresponding merging information to the level of detail computing unit.

[0070] The target first texture request can represent the first texture request expected to be processed in the current clock cycle. The target second texture request can represent a second texture request with the same gradient as the target first texture request.

[0071] In one example, the gradient merging unit can determine the target first texture request to be sent in the current clock cycle based on the order of each first texture request in the initial texture request data stream. For example, in the first clock cycle, the first first texture request that appears is determined as the target first texture request; in the second clock cycle, the second first texture request that appears is determined as the target first texture request, and so on. It should be understood that the gradient merging unit can also determine the target first texture request to be sent in the current clock cycle in other ways, such as by setting a loop counter.

[0072] The request set to which the first target texture request belongs includes both the first target texture request itself and the second target texture request with the same gradient. Therefore, merging information corresponding to the first target texture request can be generated based on the request set to which it belongs.

[0073] During the current clock cycle, the gradient merging unit can send the target first texture request to be sent in this clock cycle, along with the corresponding merging information, to the level of detail computing unit. It should be understood that if there is no target second texture request with the same gradient as the target first texture request, the corresponding merging information may not be sent, or it may be sent but set to a null value or a default value; this disclosure does not impose any limitations on this.

[0074] In this way, the gradient merging unit sends the first texture request sequentially within each clock cycle, and the second texture request is not sent in a separate clock cycle. This allows the gradient merging unit to complete the forwarding operation with fewer clock cycles, improving efficiency. At the same time, the process of sending the second texture request is eliminated, thus saving communication resources between the gradient merging unit and the level of detail computing unit.

[0075] For example, the initial texture requests in the current batch include request A, request B, and request C, where request A and request B have the same gradient. In the first clock cycle, the gradient merging unit identifies request A as the first target texture request to be processed in the current clock cycle and sends request A along with merging information indicating request B. In the second clock cycle, the gradient merging unit can identify request C as the first target texture request to be processed in the current clock cycle and send request C along with merging information set to null. It can be seen that within two clock cycles, the gradient merging unit completes request forwarding, improving processing efficiency and reducing the number of requests forwarded from three to two, thus saving communication resources.

[0076] Accordingly, in some embodiments, the detail level calculation unit is specifically configured to: receive the target first texture request and the corresponding merging information; calculate the detail level of the target first texture request based on the gradient of the target first texture request; determine the target second texture request based on the merging information, and determine the detail level of the target first texture request as the detail level of the target second texture request.

[0077] The level of detail (LMD) calculation unit can calculate the LMD of a first texture request within one clock cycle. Upon receiving a target first texture request, the LMD calculation unit calculates the LMD of that target first texture request based on its gradient. Simultaneously, the LMD calculation unit can synchronize this LMD to the target second texture request indicated by the merging information.

[0078] Thus, within one clock cycle, the level-of-details (LLD) computation unit calculates the LLD for only one request, but may obtain the LLD for multiple requests. For example, the initial texture requests in the current batch include requests A, B, and C, where requests A and B have the same gradient. In the first clock cycle, the LLD receives request A and a merge instruction indicating request B. The LLD can calculate the LLD for request A based on its gradient and use it as the LLD for request B. In the second clock cycle, the LLD receives request C and a merge instruction set to null. The LLD can calculate the LLD for request C based on its gradient. Therefore, within two clock cycles, the LLD obtains the LLD for three requests, achieving parallel processing, reducing redundant calculations, saving system resources, and improving processing efficiency.

[0079] As one implementation of this disclosure, within one clock cycle, not only can the calculation of the detail level of a first texture request be completed, but the assignment of the detail level of a second texture request of the same gradient can also be completed. This achieves the effect of parallel processing of multiple initial texture requests within one clock cycle, saving computing resources and improving processing efficiency.

[0080] The embodiments of this disclosure can indicate the gradient repetition relationship between initial texture requests, the first texture request and the second texture request contained in each request set in a matrix manner, and determine the target first texture request and merging information based on the matrix.

[0081] The following section explains the matrix construction process and the method for determining the first and second texture requests based on the matrix.

[0082] In some embodiments, the current batch includes k initial texture requests, where k is an integer greater than 1. The gradient merging unit is specifically configured to: perform pairwise comparisons of the gradients of the k initial texture requests to obtain Q comparison results, where Q is an integer; and construct a gradient relationship matrix L based on the Q comparison results. k L k Let L be a lower triangular matrix. k The size is k×k; in L k off-diagonal element L k When [i][j] takes the first value, it indicates that the gradients of the i-th initial texture request and the j-th initial texture request are different; in L k off-diagonal element L k When [i][j] takes the second value, it means that the gradient of the i-th initial texture request is the same as that of the j-th initial texture request; 0 < j < i ≤ k, where i and j are both integers; according to Lk The value of each element in each row determines the first and second texture requests among the k initial texture requests.

[0083] In one example, the first value can be 0, and the second value can be 1. It should be understood that the first and second values ​​can also be set to other values, requiring adjustments in subsequent calculations. For instance, if the first value is 1 and the second value is 0, then when calculating the subsequent effective label vector V, L is verified row by row. k Are all off-diagonal elements 1? For ease of understanding, this embodiment of the disclosure uses an example where the first value is 0 and the second value is 1.

[0084] The gradient merging unit first compares the gradients of the k initial texture requests pairwise, obtaining Q comparison results. Each comparison result indicates whether the gradients of the corresponding two initial texture requests are the same. If they are the same, the comparison result is assigned the first value; if they are different, the comparison result is assigned the second value.

[0085] The gradient merging unit can construct a gradient relation matrix L based on Q alignment results. k The gradient relation matrix L k Each row corresponds to an initial texture request. The values ​​of the elements below the diagonal of each row indicate the gradient repetition relationship (i.e., whether the gradients are the same) between the initial texture request in that row and the previous initial texture request. For example, if the initial texture requests in the current batch include request A, request B, and request C, and k is 3, then the gradient relationship matrix L... k It is a 3×3 lower triangular shape. Gradient relation matrix L k The first row corresponds to request A, the second row to request B, and the third row to request C. Since request A is the first initial texture request, there are no preceding initial texture requests. Gradient relation matrix L k The second row corresponds to request B, and its diagonal has one element representing the gradient repetition relationship between request B and request A. Gradient relationship matrix L k The third row corresponds to request C. Below its diagonal are two elements, which represent the gradient repetition relationship between request C and request A, respectively.

[0086] Therefore, the gradient relation matrix L k Each row corresponds to an initial texture request, and the gradient relationship matrix L k In each row, all elements above the diagonal have a value of 0, while the values ​​of the elements below the diagonal indicate the gradient repetition relationship between the initial texture request and the previous initial texture request in that row. Therefore, according to the gradient relationship matrix L... kThe value of each element in each row, specifically the value of each non-diagonal element in each row, can determine the first and second texture requests among the k initial texture requests.

[0087] In one possible implementation, the gradient merging unit is specifically configured as: row-by-row verification L k Are all off-diagonal elements the first value? For L k If all off-diagonal elements of a row are of the first value, the initial texture request corresponding to that row is determined to be a first texture request; if not all off-diagonal elements of a row are of the first value, the initial texture request corresponding to that row is determined to be a second texture request.

[0088] Gradient merging unit line-by-line verification L k Are all off-diagonal elements of the gradient relation matrix L the first value? k If all the off-diagonal elements of a row are first values, it indicates that there is no preceding initial texture request with the same gradient as the initial texture request corresponding to that row. Therefore, the initial texture request corresponding to that row can be identified as the first texture request. If not all the off-diagonal elements of a row are first values, it indicates that there is a preceding initial texture request with the same gradient as the initial texture request corresponding to that row. Therefore, the initial texture request corresponding to that row can be identified as the second texture request.

[0089] As one implementation of this disclosure, the gradient repetition relationship between each initial texture request is expressed by a matrix. By performing simple matrix operations, it is possible to determine whether each initial texture request is the first texture request or the second texture request. This simplifies the logic of classifying initial texture requests, reduces the requirements for hardware computing power, and improves processing efficiency.

[0090] In some embodiments, L k diagonal element L k [i][i] is used to indicate whether the i-th initial texture request is valid or invalid; the gradient merging unit is also configured to: according to L k diagonal element L k The value of [i] is used to filter out the initial texture requests that are in a valid state in the current batch; based on the gradient of each initial texture request in a valid state, the initial texture requests in a valid state are divided into the first texture request and the second texture request.

[0091] In some scenarios, the number of initial texture requests sent by the shader in each batch is preset. In other scenarios, the number of initial texture requests to be processed may not meet the requirements of a batch. In this case, the shader will add some initial texture requests that do not need to be processed and are used to fill in the gaps to the initial texture request data stream and send them together. The gradient merging unit can ignore or discard these initial texture requests used to fill in the gaps. These initial texture requests used to fill in the gaps are actually in an invalid state.

[0092] In other scenarios, some pixels may correspond to a texture image. For the initial texture request of these pixels, there is no need to calculate its level of detail, and the gradient merging unit can be ignored or discarded.

[0093] Gradient relation matrix L k It is a lower triangular matrix, where all elements above the diagonal are 0, and the values ​​of the elements below the diagonal are used to indicate the gradient repetition relationship between initial texture requests. The elements contained in the diagonal can be used to indicate whether the initial texture request is in a valid or invalid state.

[0094] For an initial texture request that is in a valid state, the gradient merging unit can further determine whether the initial texture request is a first texture request or a second texture request. For an initial texture request that is in an invalid state, the gradient merging unit can skip or discard the initial texture request.

[0095] In one example, if the diagonal element has a preset value, it can be determined that the corresponding initial texture request is valid; otherwise, it can be determined that the corresponding initial texture request is invalid. The preset value can be set as needed; for example, the preset value can be 0 or 1, etc., and this embodiment of the disclosure does not limit this.

[0096] As one implementation of this disclosure, dividing the initial texture requests into first and second texture requests only into those in a valid state can improve processing efficiency and save system resources. Using the diagonal elements of the matrix to indicate valid and invalid states simplifies the classification logic, which is beneficial for simplifying hardware circuit design and improving the anti-interference capability of batch requests.

[0097] The process of determining the first texture request of the target based on the matrix is ​​explained below.

[0098] In some embodiments, the gradient merging unit is specifically configured as: line-by-line verification L k Check if all off-diagonal elements are first values ​​to obtain a valid label vector V; for the m-th element V[m] in V, if L k If all non-diagonal elements in the m-th row are the first value, then V[m] takes the value 1. If L kIf not all non-diagonal elements in the m-th row are first values, then V[m] takes the value 0, 0 < m ≤ k, where m is an integer; sum the elements of V to obtain the total number of first texture requests in the current batch; perform a prefix sum calculation on the elements of V to obtain the processing sequence number of each first texture request in the current batch; obtain the current count value of the loop counter; the initial value of the loop counter is 0, and the value of the loop counter is incremented by 1 for each first texture request sent to the detail level computing unit; if the value of the loop counter reaches the total number, the value of the loop counter is cleared to zero; the first texture request whose processing sequence number is equal to the current count value is determined as the target first texture request.

[0099] Since a value of 1 for V[m] indicates that the m-th initial texture request is the first texture request, and a value of 0 for V[m] indicates that the m-th initial texture request is the second texture request, summing the elements of V yields the total number of first texture requests in the current batch. This total number can represent the number of requests the gradient merging unit needs to send to the level-of-details (LND) computation unit, the number of levels of detail the LND computation unit needs to compute based on gradients, the number of clock cycles required for the gradient merging unit to send first texture requests, and the number of clock cycles required for the LND computation unit to process the initial texture requests in the current batch.

[0100] Since the element corresponding to the first texture request in V has a value of 1, and the element corresponding to the second texture request has a value of 0, for any element in V with a value of 1, summing the values ​​of that element and all its preceding elements gives us the nth first texture request in the current batch, i.e., the processing sequence number of the first texture request corresponding to that element. For example, the initial texture requests in the current batch include requests A, B, and C, where requests A and B have the same gradient, resulting in V = [1, 0, 1]. The first element of V has a value of 1, representing that request A is the first texture request; the second element of V has a value of 0, representing that request B is the first texture request; and the third element of V has a value of 1, representing that request C is the first texture request. The prefix sum of the first element of V is 1, indicating that the processing sequence number of request A is 1; the prefix sum of the third element of V is 1 + 0 + 1 = 2, indicating that the processing sequence number of request C is 2.

[0101] The gradient merging unit sets a loop counter, which is initially set to 0. Each time the gradient merging unit sends a first texture request to the level of detail (LLD) unit (i.e., every clock cycle), the loop counter increments by 1. Once the gradient merging unit has sent all first texture requests in a batch to the LLD unit, the loop counter is reset to zero. The loop counter is then incremented again when the gradient merging unit begins processing the next batch of first texture requests. Therefore, the value of the loop counter indicates the number of first texture requests sent in the current batch by the gradient merging unit.

[0102] Each time the gradient merging unit sends a first texture request, the loop counter is incremented by 1. The gradient merging unit can send one first texture request per clock cycle. Therefore, in each clock cycle, the gradient merging unit can obtain the current count value of the loop counter and then determine the first texture request with a processing sequence number equal to that current count value as the target first texture request to be processed in the current clock cycle.

[0103] In one implementation of this disclosure, a loop counter can be set to determine the processing sequence number of the first texture request to be processed in each clock cycle, thereby identifying the first texture request to be processed in each clock cycle. This maintains the processing order of the first texture requests while avoiding omissions, improving reliability and timing correctness.

[0104] The process of determining the merged information based on the matrix is ​​explained below.

[0105] In some embodiments, the gradient merging unit is specifically configured to: perform gradient merging on L k Transpose the matrix to obtain the transpose matrix U. k U k Each row corresponds to a different set of requests at different gradients; from U k Obtain the target row corresponding to the first texture request of the target; use the target row as the merging information corresponding to the first texture request of the target.

[0106] Gradient relation matrix L k It is a lower triangular matrix, therefore the transpose matrix U k It is an upper triangular matrix. The transpose matrix U k Elements below the diagonal are 0, while elements above the diagonal indicate the gradient repetition relationship between initial texture requests. The diagonal elements indicate whether an initial texture request is valid or invalid. Transpose matrix U k Different rows correspond to different gradient request sets. Therefore, after determining the target first texture request to be sent in the current clock cycle, the target row can be determined and used as the corresponding merging information.

[0107] As one implementation of this disclosure, the target row of the transpose matrix indicates the target second texture request, eliminating the need to independently send the second texture request in a separate clock cycle, thus improving efficiency and saving communication resources.

[0108] In some embodiments, the detail level calculation unit is specifically configured to: determine the target second texture request based on the elements in the target row that have a value above the diagonal that are a second value.

[0109] The level of detail (LMD) calculation unit receives the target row as the merging information. It then identifies the elements in the target row whose values ​​above the diagonal are the second values. Based on the positions of these elements in the target row, it determines the order of the target second texture requests and inserts them in this order when forming the LMD output. For example, the initial texture request data stream includes requests 1, 2, and 3 in sequence. Requests 1 and 2 have the same gradient, while requests 1 and 3 have different gradients. Upon receiving request 1, the LMD calculation unit calculates level of detail 1 based on its gradient and determines that request 2's level of detail is also level of detail 1. Upon receiving request 3, it calculates level of detail 3 based on its gradient. The LMD calculation unit then outputs level of detail 1, level of detail 1, and level of detail 3 in sequence.

[0110] As one implementation of this disclosure, by transposing the matrix, the logic of processing the matrix row by row in the hardware is better adapted, the time for the detail level computing unit to retrieve the second texture request is shortened, the efficiency of retrieving the second texture request is improved, thereby improving the efficiency of detail level synchronous assignment and improving the overall processing efficiency.

[0111] In this embodiment, the gradient merging unit needs to identify which pixels have identical initial texture request gradients and pass this comparison result to the level-of-details (LHD) computation unit in a certain data format. This allows the LHD computation unit to synchronize the LHD, thereby avoiding power consumption overhead caused by repeatedly calculating the same gradients. In this embodiment, the matrix processing method is more systematic and requires fewer bits for downstream synchronization of calculation results, resulting in a smaller amount of merged information. In this embodiment, other methods can also be used to pass the comparison results; this embodiment does not impose any limitations.

[0112] In one example, if the goal is not to carry this information with the fewest possible bits or to minimize power consumption, then every two gradients are compared and a 1-bit characteristic signal is added to confirm whether they are synchronized. If they are the same, it counts as one; if they are different, it counts as two.

[0113] In another example, a signal AA with a bit width equal to the number of initial texture requests in the current batch can be used, with each bit corresponding to whether the current initial texture request is a unique gradient (i.e., whether it is the first texture request); then, N sets of signals BB0, BB1, ..., BBN with bit widths equal to the number of initial texture requests in the current batch (N equals the number of initial texture requests in the current batch) can be used to mark other initial texture requests that are completely consistent with the gradient of the current initial texture request; AA is used to determine whether to calculate the level of detail based on the current gradient, and BBN and the calculated level of detail are passed downstream for synchronizing the level of detail.

[0114] In some embodiments, the texture processing apparatus provided in this disclosure further includes a state and coordinate synchronization unit and a texel address calculation unit. The state and coordinate synchronization unit is connected to the gradient merging unit, and the level of detail calculation unit is connected to the texel address calculation unit. The state and coordinate synchronization unit is configured to receive an initial texture request data stream, which includes the plurality of initial texture requests, align the pixel coordinates and gradients of each initial texture request in the initial texture request data stream, and send the aligned initial texture requests as a batch to the gradient merging unit. The texel address calculation unit is configured to determine the video memory address of each initial texture request based on the pixel coordinates and level of detail of each initial texture request.

[0115] The state and coordinate synchronization unit can receive an initial texture request data stream sent by the shader, which includes a batch of initial texture requests. The unit aligns the pixel coordinates and gradients of these initial texture requests to obtain multiple pixel coordinate and gradient pairs. Then, the state and coordinate synchronization unit can send these pixel coordinate and gradient pairs as one implementation of the initial texture request to the gradient merging unit. The gradient merging unit can extract the gradient from each pixel coordinate and gradient pair, and thus determine whether each pixel coordinate and gradient pair belongs to the first texture request or the second texture request.

[0116] After obtaining the detail level of each pixel coordinate and gradient pair, the detail level calculation unit sends these pixel coordinates, gradient pairs, and detail level to the texel address calculation unit.

[0117] The texel address calculation unit can obtain the memory address of each pixel (i.e., each initial texture request) based on pixel coordinates and level of detail.

[0118] As one implementation of this disclosure, the alignment of pixel coordinates and gradients is achieved through a state and coordinate synchronization unit, and the video memory address is obtained through a texel address calculation unit, thereby enabling the GPU to obtain the texel corresponding to the pixel and realize image rendering.

[0119] The texture processing apparatus according to the embodiments of this disclosure is adapted to various graphics processing scenarios such as 3D graphics rendering, game screen rendering, and image modeling.

[0120] In addition, this disclosure also provides an electronic device and a texture processing method. The electronic device may include the texture processing apparatus provided in the embodiments of this disclosure, and the texture processing method may be implemented by the texture processing apparatus provided in the embodiments of this disclosure. The corresponding technical solutions and descriptions are described in the corresponding descriptions in the apparatus section, and will not be repeated here.

[0121] Figure 2 This is a block diagram of an electronic device provided according to an embodiment of the present disclosure. (Refer to...) Figure 2 This disclosure provides an electronic device, which includes a coloring device 20 and any of the texture processing devices 10 provided in this disclosure, wherein the coloring device 20 is configured to send an initial texture request to the texture processing device.

[0122] Figure 3 This is a block diagram of an electronic device provided according to an embodiment of the present disclosure. (Refer to...) Figure 3 This disclosure provides an electronic device including a shading device, a texture processing device, and a cache system. The texture processing device includes a texture sampler module and a texture filter module. The texture sampler module includes a state and coordinate synchronization unit, a gradient merging unit, a level of detail (LOD) calculation unit, and a texel address calculation unit.

[0123] The shader is configured to send initial texture requests in batches, with each batch forming an initial texture request data stream. Each initial texture request carries a state parameter and pixel coordinates. In gradient mode, the state parameter includes the gradient. Both the state parameter and the pixel coordinates can be stored in a cache system.

[0124] The texture sampling module can obtain state parameters and pixel coordinates from the cache system, and it can also obtain the sampler state from the cache system, such as addressing mode, filtering rules, and LOD control threshold. In this embodiment, the acquisition of state parameters and pixel coordinates by the texture sampling module is referred to as the texture sampling module receiving the initial texture request.

[0125] The state and coordinate synchronization unit is configured to align the pixel coordinates and gradients for each initial texture request in the current batch.

[0126] The gradient merging unit is configured to: upon receiving multiple initial texture requests in the current batch, divide the multiple initial texture requests into first texture requests and second texture requests based on the gradient of each initial texture request; wherein different first texture requests have different gradients, and each second texture request contains first texture requests with the same gradient.

[0127] The detail level calculation unit is configured to: for each first texture request, determine the detail level of the first texture request based on the gradient of the first texture request, and, if there is a second texture request with the same gradient as the first texture request, determine the detail level of the first texture request as the detail level of the second texture request.

[0128] The texel address calculation unit is configured to determine the video memory address of each initial texture request based on the pixel coordinates and level of detail of each initial texture request. The video memory address can be an address in the cache system.

[0129] The texture filtering module is a hardware processing unit within the texture processing device. Its inputs are texture coordinates, level of detail, and texels read from video memory addresses. The output is the final pixel color after interpolation smoothing. The texture filtering module is configured to filter based on the read texels to eliminate jagged edges, mosaic effects, and blurring distortion caused by texture magnification or reduction.

[0130] It should be understood that the shading apparatus provided in the embodiments of this disclosure may be referred to as a shader, and the texture processing apparatus may be referred to as a texture processor unit (TPU).

[0131] The electronic devices provided in this disclosure can be user equipment (UE), mobile devices, user terminals, cellular phones, cordless phones, personal digital assistants (PDAs), handheld devices, computing devices, in-vehicle devices, wearable devices, etc.

[0132] In some embodiments, the electronic device provided in this disclosure includes a graphics processor (GPU), which includes the texture processing means described above.

[0133] Figure 4 This is a flowchart illustrating a texture processing method provided in an embodiment of the present disclosure. The method can be applied to a gradient merging unit of a texture processing apparatus, which further includes a level-of-detail calculation unit connected to the gradient merging unit. (Refer to...) Figure 4 The method includes steps S41 and S42.

[0134] In step S41, when multiple initial texture requests in the current batch are received, the multiple initial texture requests are divided into first texture requests and second texture requests according to the gradient of each initial texture request; wherein, the gradients of different first texture requests are different, and each second texture request has a first texture request with the same gradient.

[0135] In step S42, a first texture request is sent to the level of detail calculation unit so that the level of detail calculation unit can determine the level of detail of the first texture request based on the gradient of the first texture request, and if there is a second texture request with the same gradient as the first texture request, determine the level of detail of the first texture request as the level of detail of the second texture request with the same gradient.

[0136] Figure 5 This is a flowchart illustrating a texture processing method provided in an embodiment of the present disclosure. The method can be applied to a detail level calculation unit of a texture processing apparatus, which further includes a gradient merging unit connected to the detail level calculation unit. (Refer to...) Figure 5 The method includes steps S51 and S52.

[0137] In step S51, a first texture request is received from the gradient merging unit.

[0138] In step S52, for each first texture request, the level of detail of the first texture request is determined based on the gradient of the first texture request, and if there is a second texture request with the same gradient as the first texture request, the level of detail of the first texture request is determined as the level of detail of the second texture request with the same gradient; the first texture request and the second texture request are obtained by dividing multiple initial texture requests in the current processing batch based on gradient; wherein, the gradients of different first texture requests are different, and each second texture request has a first texture request with the same gradient.

[0139] Figure 6 A flowchart illustrating a texture processing method provided in this disclosure. This method can be applied to a texture processing apparatus. (Refer to...) Figure 6 The method may include steps S61 and S62.

[0140] In step S61, when multiple initial texture requests in the current batch are received, the multiple initial texture requests are divided into first texture requests and second texture requests according to the gradient of each initial texture request; wherein, different first texture requests have different gradients, and each second texture request has a first texture request with the same gradient.

[0141] In step S62, for each first texture request, the level of detail of the first texture request is determined based on the gradient of the first texture request, and if there is a second texture request with the same gradient as the first texture request, the level of detail of the first texture request is determined as the level of detail of the second texture request with the same gradient.

[0142] The following description, with reference to examples, illustrates a texture processing method provided in this disclosure. This method can be applied to a texture processing apparatus, which includes interconnected gradient merging units and detail level calculation units.

[0143] The gradient merging unit compares the gradients of multiple initial texture requests in the same batch to see if they are the same, and merges the initial texture requests with the same gradient into a single level-of-details calculation. The level-of-details calculation unit processes different gradients (i.e., the first texture request) sequentially and synchronizes the level-of-details calculation results to all initial texture requests with the same gradient (i.e., the second texture request).

[0144] The detail level computation unit can complete all the operations for one pixel every m clock cycles, which is all the detail level operations for an initial texture request gradient. Here, m is an integer.

[0145] In related technologies, without increasing the level of detail (LMD) computation unit, completing the LMD operation for a single input of k pixels (i.e., the current batch of k initial texture requests) requires (m+k-1) clock cycles. For example, assuming the current batch inputs 4 initial texture requests, and each initial texture request can complete the LMD operation within 3 clock cycles (k=4 and m=3), then a total of (m+k-1) = 6 clock cycles are required. Let the 4 initial texture requests be denoted as request A, request B, request C, and request D. The operations performed by request A in 3 clock cycles are denoted as A1, A2, and A3, and the operations for requests B, C, and D are similarly denoted, and will not be elaborated further here. In the first clock cycle, the level-of-details computation unit executes A1; in the second clock cycle, it executes B1+A2; in the third clock cycle, it executes C1+B2+A3; in the fourth clock cycle, it executes D1+C2+B3; in the fifth clock cycle, it executes D2+C3; and in the sixth clock cycle, it executes D3. A total of 6 clock cycles are required.

[0146] In this embodiment, a gradient merging unit is added without increasing the level of detail calculation unit. If there are w unique gradients among the k initial texture requests (i.e., w first texture requests), k ≥ w, where w is an integer, then completing the level of detail calculation for the k initial texture requests requires a total of (m + w - 1) clock cycles. When w is much smaller than k, efficiency can be effectively improved, resources can be saved, and performance can be significantly enhanced.

[0147] The following example illustrates the method provided in this disclosure embodiment, where k is 4, meaning there are 4 initial texture requests in the current batch, denoted as Request A, Request B, Request C, and Request D respectively. Request A and Request B have the same gradient, while Request A, Request C, and Request D have different gradients.

[0148] Step 1: The gradient merging unit compares whether the gradients of the k initial texture requests are the same.

[0149] In gradient mode, the state parameters of the initial texture request include the gradient. The gradient merging unit can perform pairwise comparisons of the gradients of k initial texture requests. The comparison items include the gradient pattern in the level of detail calculation and the gradient value (4 gradient values ​​in 2D scenes and 6 gradient values ​​in 3D scenes), resulting in Q comparison results. Where Q = (k × (k-1)) / 2.

[0150] With k = 4, Q = 6. That is, the initial texture request of 4 pixels can yield 6 matching results, which are denoted as request A = request B, request A = request C, request A = request D, request B = request C, request B = request D, and request C = request B.

[0151] Step 2: Based on the Q alignment results obtained in Step 1, the gradient merging unit establishes the gradient relationship matrix L. k Gradient relation matrix L k It is a lower triangular matrix with a size of k×k.

[0152] Gradient relation matrix L k diagonal element L k [i][i] indicates whether the initial texture request is valid or invalid. In one example, L k A value of 1 for [i][i] indicates that the i-th initial texture request is valid and requires level-of-detail calculation; L k The value of [i][i] is 0, indicating that the i-th initial texture request is invalid and does not require detailed calculation. For ease of description, this embodiment of the disclosure takes the example where all initial texture requests in the current batch are valid.

[0153] Gradient relation matrix L k off-diagonal element L k [i][j] indicates whether the gradients of the i-th initial texture request and the j-th initial texture request are the same, where i>j. In one example, when L k The value of [i][j] being 1 indicates that the gradient of the i-th initial texture request is the same as that of the j-th initial texture request; when L k The value of [i][j] is 0, which means that the gradient of the i-th initial texture request is different from that of the j-th initial texture request.

[0154] For the gradient relation matrix L k Transposing the matrix U yields the transpose matrix U. k It is an upper triangular matrix.

[0155] Based on the six alignment results from step one, a gradient relationship matrix L can be constructed as shown in Formula 1. k .

[0156] Formula 1.

[0157] Gradient relation matrix L k Each row can be used to indicate the gradient repetition relationship between the initial texture request corresponding to the current row and the previous initial texture request. Referring to Formula 1, L... k The first line indicates the gradient repetition relationship between the first initial texture request (i.e., request A) and the preceding initial texture request (which does not exist), L k The second line indicates the gradient repetition relationship between the second initial texture request (i.e., request B) and the preceding initial texture request (i.e., request A), L k The third line indicates the gradient repetition relationship between the third initial texture request (i.e., request C) and the preceding initial texture requests (i.e., requests A and B), L k The fourth line indicates the gradient repetition relationship between the fourth initial texture request (i.e., request D) and the preceding initial texture requests (i.e., requests A, B, and C).

[0158] Referring to Formula 1, since the gradients of requests A and B are the same, and the gradients of requests A, C, and D are all different, the alignment results are as follows: Request B equals 1 if it is equal to Request A, 0 if it is equal to Request A, 0 if it is equal to Request C, 0 if it is equal to Request B, 0 if it is equal to Request D, 0 if it is equal to Request A, 0 if it is equal to Request B, and 0 if it is equal to Request C. Assuming that requests A, B, C, and D are all valid, then... .

[0159] Transposing Equation 1 yields the transpose matrix U shown in Equation 2. k .

[0160] Formula 2.

[0161] transpose matrix U k Each row indicates all initial texture requests with the same initial texture request gradient as the current row. Referring to Formula 2, U... k The first line indicates the set of initial texture requests that have the same gradient as the first initial texture request (i.e., request A), U k The second line indicates the set of initial texture requests with the same gradient as the second initial texture request (i.e., request B), U k The third line indicates the set of initial texture requests that have the same gradient as the third initial texture request (i.e., request C), U k The fourth line indicates the set of initial texture requests that have the same gradient as the fourth initial texture request (i.e., request D).

[0162] Step 3: The gradient merging unit generates a valid label vector V, and the level-of-details computation unit calculates its prefix sum.

[0163] Gradient merging unit row-by-row verification of the lower triangular matrix L k The valid label vector V is obtained by checking if all the off-diagonal elements of the m-th row are 0, as shown in Formula 3. V[m] represents the m-th vector of V, where 0 < m ≤ k and m is an integer. If all the off-diagonal elements of the m-th row are 0, then V[m] takes the value 1; otherwise, V[m] takes the value 0.

[0164] V = [V[1], V[2], ..., V[k]] Formula 3.

[0165] Where V[m] takes a value of 1, it means that the gradient of the m-th initial texture request is not repeated with the gradient of the previous initial texture request, and the level of detail needs to be calculated based on the gradient. V[m] takes a value of 0, it means that the gradient of the m-th initial texture request is repeated with the gradient of the previous initial texture request, and there is no need to calculate it again.

[0166] The gradient merging unit sums the effective label vectors V to obtain the total number V of the first texture requests in the current batch. sum Among them, V sum This indicates the number of first texture requests that need to be sent, and also the number of times level-of-detail calculations need to be performed based on the gradient.

[0167] The gradient merging unit performs a prefix sum calculation on each element of the effective label vector V to obtain the processing sequence number V of each first texture request in the current batch. cnt V cnt This indicates which first texture request in the current batch is being processed.

[0168] Based on the value of Formula 1, L k The non-diagonal elements of the first row are all 0, therefore V[1] takes the value 1; L k The non-diagonal elements of the second row are not all 0, therefore V[2] takes the value 0; L k The non-diagonal elements of the third row are all 0, therefore V[3] takes the value 1; L k The non-diagonal elements of the fourth row are all 0, so V[4] takes the value 1. That is, the value of formula 3 is V=[1,0,1,1]. At this time, V sum =3, V cnt =[1, 1, 2, 3].

[0169] Step four: The gradient merging unit performs polling scheduling to determine the target first texture request to be sent in each clock cycle.

[0170] The gradient merging unit determines the target first texture request to be sent in the current clock cycle.

[0171] The gradient merging unit can generate a loop counter LoopCnt, which is initially set to 0. The value of the loop counter LoopCnt is incremented by 1 for each first texture request sent, and is reset to zero after all first texture requests in the current batch have been sent.

[0172] The gradient merging unit generates a mask, and then determines the target first texture request for each clock cycle based on the mask. This mask is one-hot encoded. Mask[s] represents the s-th mask, which can be determined by Equation 4.

[0173] Mask[s] = V[s] & (LoopCnt+1 == Vcnt[s]) Formula 4.

[0174] Where 0 < s ≤ k, and s is an integer. (LoopCnt+1 == Vcnt[s]) represents the comparison result between LoopCnt+1 and Vcnt[s]. If LoopCnt+1 and Vcnt[s] are equal, then (LoopCnt+1 == Vcnt[s]) takes the value 1; if LoopCnt+1 and Vcnt[s] are not equal, then (LoopCnt+1 == Vcnt[s]) takes the value 0. "&" represents the AND operation.

[0175] The gradient merging unit can select an initial texture request from the first to the kth initial texture requests based on the s-th mask as the target first texture request corresponding to the s-th clock cycle; the comparison between LoopCnt+1 and Vcnt[s] ensures that each initial texture request is processed in order.

[0176] In the first clock cycle (which can be denoted as time T0), s is iterated. If the value of s is 1, the value of LoopCnt+1 is 1, the value of Vcnt[1] is 1, (LoopCnt+1==Vcnt[1]) is 1, and the value of V[1] is 1. Therefore, the value of Mask[1] is 1. If the value of s is 2, the value of LoopCnt+1 is 1, the value of Vcnt[2] is 1, (LoopCnt+1==Vcnt[1]) is 1, and the value of V[2] is 0. Therefore, the value of Mask[2] is 0. If the value of s is 3, the value of LoopCnt+1 is 1, the value of Vcnt[3] is 2, (LoopCnt+1==Vcnt[1]) is 0, and the value of V[3] is 1. Therefore, the value of Mask[3] is 0. If s is 4, LoopCnt+1 is 1, Vcnt[4] is 3, (LoopCnt+1==Vcnt[1]) is 0, and V[4] is 1, then Mask[4] is 0. Therefore, in the first clock cycle, when s is 1, Mask[s] is 1, so the target first texture request corresponding to the current clock cycle is the first initial texture request.

[0177] At this point, Mask = 4'b0001, meaning that only the first bit of the four bits in Mask is 1, and the other bits are all 0, indicating that U is passed down to the downstream level of detail computation. k The first line serves as the merge information. Because U k The first row takes the value [1, 1, 0, 0]. Therefore, the downstream level-of-detail (LND) computation unit can determine that the gradients corresponding to the first initial texture request and the second initial texture request are the same. The downstream LND computation unit can then synchronize the level-of-detail of the first initial texture request to the second initial texture request.

[0178] In the second clock cycle (which can be denoted as time T1), s is iterated. If the value of s is 1, the value of LoopCnt+1 is 2, the value of Vcnt[1] is 1, (LoopCnt+1==Vcnt[1]) is 0, and the value of V[1] is 1. Therefore, the value of Mask[1] is 0. If the value of s is 2, the value of LoopCnt+1 is 2, the value of Vcnt[2] is 1, (LoopCnt+1==Vcnt[1]) is 0, and the value of V[2] is 0. Therefore, the value of Mask[2] is 0. If the value of s is 3, the value of LoopCnt+1 is 2, the value of Vcnt[3] is 2, (LoopCnt+1==Vcnt[1]) is 1, and the value of V[3] is 1. Therefore, the value of Mask[3] is 1. Similarly, the value of Mask[4] is 1. As can be seen, in the second clock cycle, when s is 3, Mask[s] is 1. Therefore, the target first texture request corresponding to the current clock cycle is the third initial texture request.

[0179] At this point, Mask = 4'b0100, meaning that only the third bit of the four bits in Mask is 1, and the other bits are all 0, indicating that U is passed to the downstream level-of-detail computing units. k The third line serves as the merge information. Because U k The value of the third row is [0, 0, 1, 0]. Therefore, the downstream level of detail calculation unit can determine that there are no other initial texture requests with the same gradient as the third initial texture request, and there is no need to synchronize the level of detail.

[0180] In the third clock cycle (which can be denoted as time T3), s is iterated. If the value of s is 3, the value of LoopCnt+1 is 3, the value of Vcnt[3] is 2, the value of (LoopCnt+1==Vcnt[1]) is 0, and the value of V[3] is 0. If the value of s is 4, the value of LoopCnt+1 is 3, the value of Vcnt[4] is 3, the value of (LoopCnt+1==Vcnt[1]) is 1, and the value of V[4] is 0. It can be seen that in the third clock cycle, when the value of s is 3, the value of Mask[s] is 1, so the target first texture request corresponding to the current clock cycle is the fourth initial texture request.

[0181] At this point, Mask = 4'b1000, meaning that only the fourth bit of Mask is 1, and the other bits are 0, indicating that U is passed to the downstream level-of-detail computing units. k The fourth line serves as the merge information. Because U kThe first row takes the value [0, 0, 0, 1]. Therefore, the downstream level of detail calculation unit can determine that there are no other initial texture requests with the same gradient as the fourth initial texture request, and there is no need to synchronize the level of detail.

[0182] In the fourth clock cycle (which can be denoted as time T3), LoopCnt is cleared to zero, and the next batch (or the next group) of initial texture requests can be processed.

[0183] The gradient merging unit selects the target first texture request corresponding to each clock cycle based on the mask and assigns it to U. k The row serves as the merged information and is passed to the downstream detailed-level computing unit.

[0184] Step 5: The detail level calculation unit performs a detail level calculation on the target first texture request, and synchronizes the detail level to all target second texture requests with the same gradient according to the merging information passed in step 4.

[0185] It should be understood that 4'b0001 represents the binary representation of the mask signal with the first valid bit, 4'b0010 represents the binary representation of the mask signal with the second valid bit, 4'b0100 represents the binary representation of the mask signal with the third valid bit, and 4'b1000 represents the binary representation of the mask signal with the fourth valid bit.

[0186] In this embodiment of the disclosure, multiple initial texture requests that require repeated calculation of detail levels are merged into a single calculation, which directly reduces dynamic power consumption and thus improves the energy efficiency of the texture processing device.

[0187] In this embodiment of the disclosure, without increasing the level of detail computing unit and causing additional area overhead, the parallel computing effect is achieved in specific scenarios (such as scenarios with many repeated gradients), the overall performance is improved, and the latency of the overall texture sampling path is reduced at the same time.

[0188] In this embodiment of the disclosure, the existence of the gradient merging mechanism enables the preferred texture sampling device to support more concurrent texture requests (such as Sampler), improving system scalability and providing a hardware foundation for subsequent more complex algorithm optimization.

[0189] In this embodiment of the disclosure, the comparison and determination logic is simple, efficient, and time-controllable. Combined with existing resources and architecture, it achieves significant performance gains with minimal combinational logic overhead.

[0190] This disclosure implements microarchitecture optimization by inserting gradient merging units into the Sampler path architecture of related technologies, solving the problem of redundant computation with minimal combinational logic overhead. Gradient repetition relationships are systematically described using upper or lower triangular matrices, facilitating hardware implementation. A polling scheduling mechanism ensures that the first texture request is processed in sequence, avoiding conflicts and maintaining the original data flow order. A result synchronization mechanism ensures that a single computation serves multiple initial texture requests with the same gradient, facilitating subsequent operations.

[0191] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.

[0192] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).

[0193] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.

Claims

1. A texture processing device, characterized in that, It includes a gradient merging unit and a level-of-details computation unit, wherein the gradient merging unit is connected to the level-of-details computation unit; The gradient merging unit is configured to: upon receiving multiple initial texture requests in the current batch, divide the multiple initial texture requests into first texture requests and second texture requests according to the gradient of each initial texture request; wherein, different first texture requests have different gradients, and each second texture request contains first texture requests with the same gradient; The detail level calculation unit is configured to: for each first texture request, determine the detail level of the first texture request based on the gradient of the first texture request, and if there is a second texture request with the same gradient as the first texture request, determine the detail level of the first texture request as the detail level of the second texture request with the same gradient.

2. The apparatus according to claim 1, characterized in that, The gradient merging unit is specifically configured as follows: Group initial texture requests with the same gradient in the current batch into the same request set; For each request set, the target initial texture request in the request set is determined as the first texture request, and the other initial texture requests in the request set other than the target initial texture request are determined as the second texture requests.

3. The apparatus according to claim 2, characterized in that, In the received initial texture request data stream, the target initial texture request is located before other initial texture requests in the request set to which it belongs.

4. The apparatus according to claim 3, characterized in that, The gradient merging unit is specifically configured as follows: According to the order of the initial texture requests in the initial texture request data stream, traverse the multiple initial texture requests; For the initial texture request encountered during the iteration: If the initial texture request is the first initial texture request in the initial texture request data stream, a corresponding request set is created for the initial texture request; If the initial texture request is not the first initial texture request in the initial texture request data stream, and if there is a preceding initial texture request with the same gradient as the initial texture request, then the initial texture request is added to the request set corresponding to the preceding initial texture request; if there is no preceding initial texture request with the same gradient as the initial texture request, then a corresponding request set is created for the initial texture request.

5. The apparatus according to claim 2, characterized in that, The gradient merging unit is further configured to: Determine the target first texture request to be sent in the current clock cycle; Generate corresponding merging information based on the request set to which the target first texture request belongs, the merging information being used to indicate a target second texture request with the same gradient as the target first texture request; The target first texture request and the corresponding merging information are sent to the level of detail calculation unit.

6. The apparatus according to claim 5, characterized in that, The detail level computing unit is specifically configured as follows: Receive the target first texture request and the corresponding merging information; The level of detail of the target first texture request is calculated based on the gradient of the target first texture request; Based on the merged information, the target second texture request is determined, and the level of detail of the target first texture request is determined as the level of detail of the target second texture request.

7. The apparatus according to claim 6, characterized in that, The current batch includes k initial texture requests, where k is an integer greater than 1. The gradient merging unit is specifically configured as follows: The gradients of the k initial texture requests are compared pairwise to obtain Q comparison results, where Q is an integer; Based on Q alignment results, construct the gradient relationship matrix L. k L k Let L be a lower triangular matrix. k The size is k×k; in L k off-diagonal element L k When [i][j] takes the first value, it indicates that the gradients of the i-th initial texture request and the j-th initial texture request are different; in L k off-diagonal element L k When [i][j] takes the second value, it means that the gradient of the i-th initial texture request is the same as that of the j-th initial texture request; 0 < j < i ≤ k, where i and j are both integers; According to L k The value of each element in each row determines the first and second texture requests among the k initial texture requests.

8. The apparatus according to claim 7, characterized in that, The gradient merging unit is specifically configured as follows: Line-by-line verification L k Are all the off-diagonal elements equal to the first value? For L k If all off-diagonal elements of a row are the first value, the initial texture request corresponding to that row is determined to be a first texture request; if not all off-diagonal elements of a row are the first value, the initial texture request corresponding to that row is determined to be a second texture request.

9. The apparatus according to claim 7, characterized in that, L k diagonal element L k [i][i] is used to indicate whether the i-th initial texture request is valid or invalid; the gradient merging unit is also configured to: According to L k diagonal element L k The value of [i][i] is used to filter out the initial texture requests that are in a valid state in the current batch; Based on the gradient of each valid initial texture request, the valid initial texture requests are divided into the first texture request and the second texture request.

10. The apparatus according to claim 8, characterized in that, The gradient merging unit is specifically configured as follows: Line-by-line verification L k To determine if all off-diagonal elements are the first value, obtain the valid label vector V; for the m-th element V[m] in V, if L k If all non-diagonal elements in the m-th row are the first value, then V[m] takes the value 1. If L k If not all the non-diagonal elements of the m-th row are the first value, then V[m] takes the value 0, 0 < m ≤ k, where m is an integer; Sum the elements of V to obtain the total number of the first texture requests in the current batch; Calculate the prefix sum of each element of V to obtain the processing sequence number of each first texture request in the current batch; Get the current count value of the loop counter; The initial value of the loop counter is 0. Each time a first texture request is sent to the detail level calculation unit, the value of the loop counter is incremented by 1. If the value of the loop counter reaches the total number, the value of the loop counter is reset to zero. The first texture request whose processing sequence number is equal to the current count value is determined as the target first texture request.

11. The apparatus according to claim 7, characterized in that, The gradient merging unit is specifically configured as follows: For L k Transpose the matrix to obtain the transpose matrix U. k U k Each row corresponds to a different set of requests at different gradients; From U k Obtain the target row corresponding to the first texture request of the target; The target row is used as the merged information corresponding to the first texture request of the target.

12. The apparatus according to claim 11, characterized in that, The detail level computing unit is specifically configured as follows: The target second texture request is determined based on the elements in the target row that have a value above the diagonal and are of the second value.

13. The apparatus according to any one of claims 1 to 12, characterized in that, It also includes a state and coordinate synchronization unit and a texel address calculation unit. The state and coordinate synchronization unit is connected to the gradient merging unit, and the level of detail calculation unit is connected to the texel address calculation unit. The state and coordinate synchronization unit is configured to receive an initial texture request data stream, which includes the plurality of initial texture requests. The pixel coordinates and gradients of each initial texture request in the initial texture request data stream are aligned, and the aligned initial texture requests are sent as a batch to the gradient merging unit. The texel address calculation unit is configured to determine the video memory address of each initial texture request based on the pixel coordinates and level of detail of each initial texture request.

14. An electronic device, characterized in that, The invention includes a coloring apparatus and a texture processing apparatus as described in any one of claims 1 to 12, wherein the coloring apparatus is configured to send an initial texture request to the texture processing apparatus.

15. A texture request processing method, characterized in that, A gradient merging unit is applied to a texture processing apparatus, the texture processing apparatus further comprising a detail level calculation unit connected to the gradient merging unit; the method includes: When multiple initial texture requests are received in the current batch, the multiple initial texture requests are divided into first texture requests and second texture requests according to the gradient of each initial texture request; wherein, different first texture requests have different gradients, and each second texture request has first texture requests with the same gradient. A first texture request is sent to the level of detail calculation unit so that the level of detail calculation unit can determine the level of detail of the first texture request based on the gradient of the first texture request, and, if there is a second texture request with the same gradient as the first texture request, determine the level of detail of the first texture request as the level of detail of the second texture request with the same gradient.

16. A texture request processing method, characterized in that, A detail level calculation unit is applied to a texture processing apparatus, the texture processing apparatus further comprising a gradient merging unit connected to the detail level calculation unit; the method includes: Receive a first texture request from the gradient merging unit; For each first texture request, the level of detail of the first texture request is determined based on the gradient of the first texture request, and if there is a second texture request with the same gradient as the first texture request, the level of detail of the first texture request is determined as the level of detail of the second texture request with the same gradient; the first texture request and the second texture request are obtained by dividing multiple initial texture requests in the current processing batch based on gradient; wherein, the gradients of different first texture requests are different, and each second texture request has a first texture request with the same gradient.

17. A texture request processing method, characterized in that, Applied to a texture processing apparatus, the method includes: When multiple initial texture requests are received in the current batch, the multiple initial texture requests are divided into first texture requests and second texture requests according to the gradient of each initial texture request; wherein, different first texture requests have different gradients, and each second texture request has first texture requests with the same gradient. For each first texture request, the level of detail of the first texture request is determined based on the gradient of the first texture request, and if there is a second texture request with the same gradient as the first texture request, the level of detail of the first texture request is determined as the level of detail of the second texture request with the same gradient.