Texture sampler, and method for realizing texture feedback

By introducing a texture sampler feedback mechanism into the GPU, the statistical block technology of the texture address processing module and the texture filtering module is used to solve the problem of video memory waste caused by texture loading, and improve the memory utilization and operation efficiency.

WO2025146097A1PCT designated stage expired Publication Date: 2025-07-10MOORE THREADS TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/070235
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-02
Filing Date
2025-01-02
Publication Date
2025-07-10

AI Technical Summary

Technical Problem

In GPU, due to the large texture size and dynamic updates when loading, the memory usage increases. It is difficult for the existing technology to efficiently manage texture loading, resulting in waste of resources.

Method used

The texture sampler feedback mechanism is adopted to optimize texture loading through the texture address processing module and texture filtering module statistical blocks, providing texture hierarchy and coordinate information feedback, and improving memory utilization.

Benefits of technology

Through the sampler feedback mechanism, unnecessary video memory usage is reduced, video memory utilization and operation efficiency are improved, and texture loading process is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025070235_10072025_PF_FP_ABST
    Figure CN2025070235_10072025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed are a texture sampler, and a method for realizing texture feedback. The texture sampler comprises a texture address processing module and a texture filtering module. The texture address processing module samples at least one group of texels that are associated with pixels and located at one level of texture, wherein each group of texels comprise at least one texel. The texture address processing module transfers level information and coordinate information of the at least one group of texels to the texture filtering module. The texture filtering module compiles statistics on a region of a statistics block size in a texture space during each instance of compiling statistics, and the texture filtering module acquires a starting point of one of the at least one group of texels during each instance of compiling statistics, such that a statistics block has the same starting point as the corresponding group of texels, and the group of texels are included in the statistics block size. The texture filtering module compiles statistics at least once, and after each instance of compiling statistics, the texture filtering module returns the aligned block where the starting point of the statistics block is located, and returns a positional offset of the starting point of the statistics block relative to a starting point of the aligned block in which the starting point of the statistics block is located. Aligned blocks are densely arranged and aligned in a manner of fully covering the texture space.
Need to check novelty before this filing date? Find Prior Art

Description

Texture samplers and methods for implementing texture feedback

[0001] This application claims priority to Chinese patent application No. 202410006128.2, filed on January 2, 2024, entitled “Texture Sampler and Method for Implementing Texture Feedback”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present disclosure relates to a texture sampler for implementing texture feedback in a GPU (Graphics Processing Unit), and also to a method and program for implementing texture feedback. Background Art

[0003] The original execution process inside the GPU is that the internal processing module obtains the normalized coordinates sent by the upstream module, calculates the coordinates and texture level (mip level) of the corresponding texture space, obtains the color data of the corresponding texture coordinates from the video memory, and performs specified filtering calculations on the sampled texture color to obtain the final sampled color and return it. Finally, the colors of the area that needs to be rendered are all calculated and written to the video memory. Summary of the Invention

[0004] However, in the GPU, texture loading for tiled resources is dynamically updated, and the texture size may be very large. If many textures that are not actually used are loaded, the memory usage will be greatly increased.

[0005] To solve the above problems, the present disclosure utilizes sampler feedback. Sampler feedback allows the loading and usage status of each texture level of the texture when the GPU texture is sampled to be provided, and the feedback is fed back to the driver to help the driver know which textures and corresponding texture levels need to be loaded first when loading the texture next time.

[0006] According to one aspect of the present disclosure, a texture sampler is proposed, including a texture address processing module and a texture filtering module, wherein the texture address processing module samples at least one group of texels in a level of the texture associated with a pixel, each group of texels including at least one texel, and the texture address processing module transmits the level information and coordinate information of the at least one group of texels to the texture filtering module; the texture filtering module sets a statistical block according to the level information and coordinate information, and counts an area of ​​the size of the statistical block in the texture space each time, wherein the texture filtering module obtains the starting point of a group of texels in the at least one group of texels each time it counts, so that the statistical block has the same starting point as the corresponding group of texels and the group of texels is included in the statistical block size, the texture filtering module performs at least one statistical operation, and each statistical operation returns the alignment block where the starting point of the statistical block is located and the position offset of the starting point of the statistical block relative to the starting point of the alignment block where it is located, and the alignment blocks are densely aligned in a manner that fills the texture space.

[0007] According to another aspect of the present disclosure, a method for implementing texture feedback is provided, comprising the following steps: a texture shader issues a sampler feedback command to a texture sampler for returning a position of at least one group of texels in a level of a texture associated with a pixel; a texture address processing module of the texture sampler receives the sampler feedback command, samples at least one group of texels in the level, each group of texels including at least one texel, and transmits level information and coordinate information of the at least one group of texels to a texture filtering module of the texture sampler; the texture filtering module sets a statistical block based on the level information and coordinate information, and each time performs statistics on an area of ​​the size of the statistical block in a texture space, wherein the texture filtering module obtains a starting point of a group of texels in the at least one group of texels during each statistics, so that the statistical block has the same starting point as a corresponding group of texels and the group of texels is included in the size of the statistical block; the texture filtering module performs statistics at least once, and each time the statistics are performed, returns to the texture shader the alignment block in which the starting point of the statistical block is located and a position offset of the starting point of the statistical block relative to the starting point of the alignment block in which the statistical block is located, wherein the alignment blocks are densely aligned to fill the texture space.

[0008] The present disclosure also provides a program for implementing a texture sampler and texture feedback and a computer-readable storage medium including the program. According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by one or more processors, the computer program implements the above method.

[0009] According to another aspect of the present disclosure, a chip is provided, which includes a programmable logic circuit and / or program instructions, and is used to implement the above method when the chip is running.

[0010] According to another aspect of the present disclosure, a computer device is provided. The computer device includes a processor and a memory. A computer program is stored in the memory. The computer program is loaded and executed by the processor to implement the above method.

[0011] According to another aspect of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is loaded and executed by a processor to implement the above method.

[0012] According to the present disclosure, the efficiency of sampler feedback is improved, and the required texture coordinates and corresponding texture level information are directly fed back, thereby avoiding unnecessary video memory usage and improving video memory utilization. In addition, according to the present disclosure, even when different texel sampling methods are used, the statistical information of the statistical block can be returned by simply reusing the sampler feedback command, while also reducing the number of additional returns and improving operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] FIG1 schematically shows a schematic block diagram of a GPU for implementing sampler feedback;

[0014] FIG2 schematically shows a schematic flow chart for implementing texture feedback according to the present disclosure;

[0015] FIG3 schematically shows a block distribution of texels sampled back in a conventional manner;

[0016] FIG4 schematically shows a schematic diagram of a statistical block distribution of texels for return sampling according to the present disclosure;

[0017] FIG5 schematically shows a block distribution restored in a position-aligned manner;

[0018] FIG6 schematically shows a schematic diagram of different levels of the original feedback map to be updated for the sampled texture;

[0019] FIG7 schematically shows a schematic diagram of the distribution of statistical blocks in the first sampling mode;

[0020] 8 and 9 schematically illustrate the distribution of statistical blocks in the second sampling mode;

[0021] FIG10 schematically shows a schematic diagram of the distribution of statistical blocks in the third sampling mode;

[0022] FIG11 schematically shows a schematic diagram of the distribution of statistical blocks in the fourth sampling mode;

[0023] FIG12 schematically shows a schematic diagram of the distribution of statistical blocks in the fifth sampling mode;

[0024] FIG13 schematically illustrates different levels of an original feedback map for an example update of a sampled texture;

[0025] FIG14 schematically illustrates an example minimum raw feedback map of a sampled texture;

[0026] FIG15 schematically shows a flow chart of a method for implementing texture feedback according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] The present disclosure proposes a solution for implementing texture sampler feedback in a GPU, and FIG1 shows a schematic block diagram of a GPU in which sampler feedback is implemented. When a texture is sampled, in order to obtain the area where the texture is actually used and the corresponding texture level based on the pixel, a shader is used to initiate sampler feedback (Sampler Feedback), and feedback is implemented through the texture sampler in a loop with a certain number of pixels (for example, 1, 2, 3...8 or more). The texture sampler calculates the associated address and texture size for each pixel, obtains information about the coordinates and texture level of the sampled texture, and feeds it back to the shader. In some embodiments, the sampler feedback can be an SMP.footprint command. A schematic flow chart for implementing the above process is shown in FIG2.

[0028] As shown in Figure 2, shader 1 issues a sampler feedback command to the texture sampler. Shader 1 issues SMP.footprint commands to the texture sampler in a loop, for example, in units of 8 pixels, until all sampling points that require sampler feedback have been fed back.

[0029] In some embodiments, the sampler feedback command of shader 1 may include the following information: normalized coordinates (u, v, s), specifying the required increased texture space coordinate granularity (region_size), the texel group address and texel group subaddress (area_id, sub_area_id) associated with the pixel to be sampled, and the required level of detail (lod), the position of the alignment block in the texture space of one level of the texture (blk_x, blk_y), the position offset of the starting point of the statistics block for counting the texel group from the starting point of the alignment block in which it is located (region_offset), the position mask information of the sampled texel in the texture space (regions_mask), and the texel group position return count parameters (area_count, sub_area_count). Texels are also called texture elements, texture pixels, etc. The aligned block refers to a block of a specific size that is densely packed and aligned in a manner that fills the texture space at a specified coordinate granularity, such as a texture space with increased coordinate granularity, so that there is no gap between the aligned blocks and they do not overlap with each other, and they can cover all texels in the texture space. The statistical block is, for example, a block of a specific size for performing statistics on texel groups in a texture space with increased coordinate granularity. The first texture point of each group of texels can be used as the starting point of the texel group, and a texel refers to a unit texel in the texture space with increased coordinate granularity, and the size of the aligned block limits the amount of texels sampled by the texture sampler each time. In some embodiments, the aligned block size can be, for example, selected as 8x4, which has the same size as the statistical block. Each time, as long as there is one texel in the texture space with increased coordinate granularity covered by the statistical block that needs to be sampled, the position in the corresponding 8x4 statistical block is marked (mask=1).

[0030] In some embodiments, each time shader 1 receives feedback from a texture sampler, it determines whether feedback has been completed for the current eight pixels based on the feedback result. If not, it continues to issue sampler feedback commands in a loop. When feedback for eight pixels is complete, shader 1 continues to issue sampler feedback commands for the next eight pixels until all pixels requiring feedback have completed sampler feedback.

[0031] In some embodiments, the shader 1 determines whether the sampler has returned information about all texels associated with a pixel of interest in at least one texture level based on parameters area_count and sub_area_count. If feedback is provided a number of times corresponding to the number of returns determined by the parameters area_count and sub_area_count, it is determined that information about all texels associated with the pixel of interest in at least one texture level has been returned. Otherwise, it is determined that information about all texels associated with the pixel of interest has not yet been returned. Parameters area_count and sub_area_count are explained below.

[0032] On the other hand, the texture sampler receives a command from the shader 1, and the texture address processing module 2 of the texture sampler determines the sampled texels based on the sampling method. For example, depending on the sampling method, the texture address processing module 2 can calculate the detail level (lod), obtain lod_ratio based on the detail level, and determine at least one level of the texture associated with the pixel (mip level 0, 1, 2, 3...). For example, when the detail level lod is 0, there is one level of the texture associated with the pixel, and lod_ratio = 1. When the detail level lod is greater than 0, there are at least two levels of the texture associated with the pixel, for example, when lod = 0.3, lod_ratio = 2. The texture address processing module 2 can determine the texture space of the corresponding texture level for each level based on the normalized coordinates sent by the shader 1, and sample at least one group of texels associated with the pixel in the texture space, where each group of texels can include one or more texels.

[0033] In some embodiments, the texture address processing module 2 may employ anisotropic filtering (AF). In this case, the texture address processing module 2 may perform anisotropic filtering on a pixel, sample multiple groups of texels associated with the pixel in the texture space, and calculate a parameter AF_ratio reflecting the number of times the texel addresses need to be returned due to the need to return multiple different texel groups due to anisotropic filtering. For example, in the case of anisotropic filtering, the texture address processing module 2 utilizes a sampling unit to sequentially sample multiple groups of texels, so that the addresses of the sampled texels can be determined and returned group by group.

[0034] In addition, in some embodiments, if the texture address processing module 2 samples in a repeat address mode, it means that a group of texels associated with a pixel may be distributed at the corners of the texture due to the address mode. In this case, it is necessary to calculate repeat_ratio, which reflects the number of returns required due to the need to obtain addresses for the texel groups at the corners of the texture multiple times. For example, in the case of a repeated edge, if the sampled texel groups are distributed at the corners of the texture, it may be necessary to return addresses for each group of texels at the corners separately. In addition, in some embodiments, the number of returns required to return the addresses of multiple groups of texels associated with pixels in at least one level of texture space can be counted, and the address information can be returned to the shader 1 one by one. The information reflecting the count may be (area_count, sub_area_count), where area_count may depend on, for example, lod_ratio and AF_ratio. Lod_ratio is determined according to the level of detail lod, for example, when the level of detail lod is 0, lod_ratio = 1; for example, when the level of detail lod = 0.3, lod_ratio = 2; AF_ratio reflects the number of times the texel address is returned due to anisotropic filtering, for example, when anisotropic filtering is not performed, AF_ratio is set to 1; when anisotropic filtering is performed, AF_ratio may be an integer greater than 1, for example, AF_ratio = 8. Therefore, area_count may be expressed as area_count = lod_ratio × AF_ratio. For example, when lod_ratio = 1 and AF_ratio = 8, area_count = 8, and eight feedbacks are required for the sampled texel group in one level. sub_area_count reflects the number of times feedback is repeated for texels at each corner when the texels to be fed back are scattered at the corners of the texture in a repeated edge sampling manner, and the size of a statistical block cannot fully cover them. It can be expressed as sub_area_count = repeat_ratio. For example, when the sampled texels are scattered at the four corners of the texture space, sub_area_count = repeat_ratio = 4, and 4 feedbacks are required. When feedback is performed a number of times corresponding to the number of returns determined by the parameters area_count and sub_area_count, information about all texels associated with the pixel in all texture levels is returned for a pixel of interest.

[0035] The sampling of texels in the texture space can be completed for all levels of the texture associated with the pixel. In some embodiments, the texture sampler may further include a texture address parsing and decompression module 3. The texture address parsing and decompression module 3 directly transmits the coordinate information and address count information (area_count, sub_area_count) sampled by the texture address processing module 2 to the texture filtering module 4. The sampler feedback action described herein is described with respect to one pixel. However, since it may be necessary to transmit texture area coordinate information and count information about multiple pixels (for example, 8 pixels) in actual applications, a large bandwidth is required. Through the texture address parsing and decompression module 3, the large bandwidth interface between the existing texture address parsing and decompression module 3 and the texture address processing module 2 can be utilized to minimize interface changes. The interface bandwidth between the texture address parsing and decompression module 3 and the texture filtering module 4 is also sufficient to transmit sampler feedback information of 8 pixels.

[0036] Here, at least one group of texels associated with a pixel may be composed of all texels associated with the pixel, or may be composed of only some of the texels associated with the pixel. In other words, all texels associated with a pixel may be included in a group of texels, or may be included in multiple groups of texels in multiple texture levels. For example, one texel associated with a pixel may constitute a group of texels. For example, all texels associated with a pixel in a texture space at one level may constitute a group of texels.

[0037] After the texture filtering module 4 receives the coordinate information and count information transmitted by the texture address resolution and decompression module 3, in order to return the position of the sampled texel to the shader 1, conventionally, in the texture space of each level associated with the pixel of the texture, the alignment blocks of the same size are used to successively count the texels of the texture in the texture space with a certain block size as the unit size. Since the statistics of the alignment blocks in the texture space are carried out in a dense manner covering the entire texture space, it is possible to determine the position of each alignment block in the texture space and the position of each texel in the alignment block. The texture filtering module 4 returns the position coordinates of the alignment block in which the sampled texel is counted, and returns the position corresponding to the sampled texel in the alignment block.

[0038] For example, as shown in FIG3 , when a group of texels associated with a pixel is four texels marked in dark gray in the texture space, in the related art, in order to count this group of texels using a position-aligned alignment block of, for example, 8×4 size, it is necessary to return information about each of the four position-aligned alignment blocks 0, 1, 2, and 3, including the position of the block (e.g., block_x=0, block_y=0, block_x=1, block_y=0, block_x=0, block_y=1, block_x=1, block_y=1) and the position of the sampled texel in the block. These positions are represented, for example, by position mask information (region_mask) of each block. The position mask information indicates whether each counted texel in the block corresponds to the sampled texel. If so, the counted texel is marked as 1 (“mask=1”). The position mask information is related to the block size, for example, 32 bits of data in the case of an 8×4 size alignment block. The texture filtering module repeatedly returns the block information until the positions of all sampled texels in the hierarchy have been returned.

[0039] However, in the above case, based on the related art, since each alignment block counts only one texel in a group of texels associated with a pixel, information of four alignment blocks needs to be returned, resulting in poor performance.

[0040] The embodiments of the present disclosure avoid returning the position of the sampled texels multiple times for a group of texels associated with a pixel. For example, as shown in FIG4 , in the case of the above example, the texture filtering module 4 of the present disclosure obtains the starting point of a group of texels associated with the pixel (in the above example, four 2×2 texels, marked in dark gray), determines the alignment block where the starting point is located, and calculates the position offset of the starting point of the group of texels relative to the starting point of the alignment block. For example, in the case of FIG4 , the texture filtering module 4 first determines the alignment block where the starting point of the 2×2 group of texels is located, and the starting point is the first texture point of the upper left vertex of the four dark gray texels. In the case of FIG4 , the alignment block is an 8×4 block represented by the position block_x=0 and block_y=0. Then, the texture filtering module 4 calculates the position offset region_offset_x=7 and region_offset_y=3 of the starting point of the 2×2 group of texels relative to the starting point of the alignment block (block_x=0, block_y=0) ((0, 0) in FIG4 ). On this basis, the texture filtering module 4 sets a statistical block of the same size as the alignment block, for example, 8×4. The statistical block is marked in light gray in FIG4 and has the same starting point as a group of 2×2 texels. Here, the size of the statistical block is set to ensure that at least one group of texels is covered. For example, an 8×4 statistical block covers all four texels in a group of 2×2 texels. At this time, it is only necessary to return a statistical block information whose starting point is in the alignment block (block_x=0, block_y=0) with a starting point of (0, 0) and a position offset (region_offset_x=7, region_offset_y=3), thereby improving processing efficiency.

[0041] Because the 8×4 statistical block is not block-aligned but contains position offset information, after receiving the pixel-associated texel position and area_count and sub_area_count parameters returned by the texture filtering module 4, the shader 1 calculates and restores the statistical block into four aligned 8×4 blocks. The region_mask of the four aligned blocks is combined with the previous result by an OR operation, and the position mask information of the four aligned blocks is updated. After the statistical block information returned in Figure 4 is restored, as shown in Figure 5, the set of texels associated with the pixel is restored to the four aligned blocks in the texture hierarchy.

[0042] It should be noted that in order to more clearly illustrate the four restored alignment blocks, Figure 5 shows the four alignment blocks separated by horizontal and vertical blanks. However, this is only to more clearly illustrate the restored alignment blocks; in practice, these alignment blocks are still aligned. In each alignment block in Figure 5, the texel associated with the pixel is also marked with a gray block marked with "1", indicating that the position masked by the texel associated with the pixel is set to 1 ("position mask = 1").

[0043] In some embodiments, the shader 1 can also determine whether the current 8 pixels need additional feedback based on parameters such as area_count and sub_area_count returned by the texture sampler. If so, the shader 1 loops and issues sampler feedback commands until all pixel sampling feedback is complete before continuing to issue the next 8-pixel command. After all pixels of the current rendering target are calculated, the shader 1 can, for example, update the level of the original feedback map of the texture based on the calculation results at a set texture space coordinate granularity.

[0044] For example, when the texture to be sampled is 128×128 in size and the texture space coordinate granularity is 16×16, the hierarchy of the original feedback map that shader 1 needs to update is shown in FIG6 .

[0045] Below, in the context of the aforementioned, a solution for using a statistics block to return the positions of at least one set of texels associated with a pixel of a texture according to the present disclosure is further described in detail with respect to a common texture sampling method. It should be noted that although the shader 1 can send a sampler feedback command to the texture sampler at a granularity of multiple pixels (e.g., a granularity of 8 pixels), for ease of description, only one pixel is used as an example, and the process for other pixels is the same.

[0046] In some embodiments, first, shader 1 issues an SMP.footprint command to the texture sampler for each pixel. An example of the command is as follows: SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,0)

[0047] After receiving the SMP.Footprint command, the texture address processing module 2 calculates at least one group of sampled texels and calculates area_count and sub_area_count to determine the number of returns. The calculation scenario is explained using one pixel as an example, and the process for other pixels is the same.

[0048] In some embodiments, the first sampling mode may include: no trilinear filtering, no anisotropic filtering (AF), and no repeated edges, as shown in FIG7 .

[0049] Texture address processing module 2 calculates lod = 0, lod_ratio = 1, and AF_ratio = 1. area_count = lod_ratio × AF_ratio = 1, and sub_area_count = 0. Taking pixel p0 as an example, the four texels associated with pixel p0 in texture space (p0t0, p0t1, p0t2, and p0t3) that need to be sampled are obtained based on the UV coordinates as a group of texels. Their example locations are marked in dark gray in Figure 7. The lod value, area_count, sub_area_count, and sampler feedback flag are sent to texture address resolution and decompression module 3.

[0050] The texture address parsing and decompression module 3 transparently transmits the sampler feedback data to the texture filtering module 4.

[0051] After receiving the information, the texture filtering module 4 obtains the starting point of the group of texels, determines the alignment block where the starting point is located, and calculates the position offset of the starting point of the group of texels relative to the starting point of the alignment block. For example, in the case of Figure 7, the texture filtering module 4 first determines the alignment block where the starting point of the group of texels is located, that is, the upper left vertex of the four dark gray texels. In the case of Figure 7, the alignment block is an 8×4 block represented by the position block_x=0, block_y=0. Then, the texture filtering module 4 calculates the position offset (region_offset_x=7, region_offset_y=3) of the starting point of the group of texels relative to the starting point of the alignment block (block_x=0, block_y=0) ((0, 0) in Figure 7). The texture filtering module 4 further sets an 8×4 statistical block with the same starting point as the group of texels. In Figure 7, the statistical block is marked with light gray and includes the dark gray texel group. The texture filter module 4 sets 32 bits of position mask information (region_mask) for the statistics block according to the twiddle layout, and returns it to the shader 1 together with the starting point of the statistics block in the alignment block with position block_x=0, block_y=0 and the position offset of the starting point of the statistics block relative to the alignment block (region_offset_x=7, region_offset_y=3). The returned region_mask information of the statistics block is shown below:

[0052] Therefore, since the statistical information of the statistical block can be returned by repeatedly utilizing the sampler feedback command while reducing the number of additional returns, the operation efficiency can be improved.

[0053] In some embodiments, the second sampling mode may be trilinear filtering, no anisotropic filtering, and no repeated edges, as shown in FIG8 . The command issued by shader 1 is as follows: SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,0)

[0054] Texture address processing module 2 calculates lod = 0.3, lod_ratio = 2, and AF_ratio = 1. area_count = lod_ratio × AF_ratio = 2. Taking p0 as an example, with area_id = 0, the set of texels (p0t0, p0t1, p0t2, p0t3) associated with pixel p0 in the first-level texture space that need to be sampled is obtained based on the UV coordinates. Their locations are marked in dark gray in Figure 8. Sub_area_count is calculated to be 0. The lod value, area_count, sub_area_count, and sampler feedback flag are sent to texture address resolution and decompression module 3.

[0055] The texture address parsing and decompression module 3 transparently transmits the received data to the texture filtering module 4 .

[0056] After receiving the information, the texture filtering module 4 obtains the starting point of the group of texels in a manner similar to the first sampling method, determines the alignment block where the starting point is located, and calculates the position offset of the starting point of the group of texels relative to the starting point of the alignment block (region_offset_x=7, region_offset_y=3). On this basis, the texture filtering module 4 sets an 8×4 statistical block with the same starting point as the group of texels. In Figure 8, the statistical block is marked with light gray and includes the dark gray texel group. Calculate the 32-bit position mask information based on the rotation layout, and return this information and area_count=2, the starting point of the statistical block is located in the determined alignment block, and the position offset of the starting point of the statistical block relative to the starting point of the alignment block to the shader 1.

[0057] When shader 1 receives area_count = 2 when area_id = 0, it means that additional block information needs to be returned for the current pixel, and shader 1 will issue the command area_id = 1 again. SMP.footprint(t#id,s#id,u,v,s,expected_region_size,1,0)

[0058] When area_id = 1, texture address processing module 2 calculates lod = 0.3, lod_ratio = 2, and AF_ratio = 1. area_count = lod_ratio × AF_ratio = 2. Taking p0 as an example, where area_id = 1, the texels associated with pixel p0 in the second-level texture space (p0t0, p0t1, p0t2, p0t3) that need to be sampled are obtained based on the UV coordinates. These are marked in dark gray in Figure 9. sub_area_count is calculated to be 0. The lod value, area_count, sub_area_count, and sampler feedback flag are sent to texture address resolution and decompression module 3, as shown in Figure 9.

[0059] The texture address parsing and decompression module 3 transparently transmits the received data to the texture filtering module 4 .

[0060] After receiving the information, the texture filtering module 4 obtains the starting point of the group of texels (marked in dark gray) in the second-level texture space, determines the alignment block where the starting point is located, and calculates the position offset of the starting point of the group of texels relative to the starting point of the alignment block (region_offset_x=3, region_offset_y=1). The texture filtering module 4 further sets an 8×4 statistical block in the second-level texture space that has the same starting point as the group of texels. In Figure 9, the statistical block is marked in light gray and includes the dark gray texel group. Calculate the 32-bit position mask information based on the rotation layout, and return this information and area_count=2 together with the starting point of the statistical block in the determined alignment block and the position offset of the starting point of the statistical block relative to the determined alignment block to the shader 1.

[0061] Therefore, since the statistical information of the statistical block can be returned by repeatedly utilizing the sampler feedback command and the number of additional returns is reduced, the operation efficiency is improved.

[0062] In some embodiments, the third sampling mode may be: repeated edges, no trilinear filtering, no anisotropic filtering, as shown in Figure 10. The command issued by shader 1 is as follows: SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,0)

[0063] When area_id = 0, texture address processing module 2 calculates lod = 0, lod_ratio = 1, AF_ratio = 1, and area_count = lod_ratio × AF_ratio = 1. Taking p0 as an example, area_id = 0, and based on the uv coordinates, a group of texels (p0t0, p0t1, p0t2, p0t3) associated with pixel p0 that needs to be sampled in the texture hierarchy is obtained. Since (t1.u - t0.u > 8) && (t2v - t0.v > 4) for p0, as shown in Figure 10, the current group of texels is distributed in four different 8×4 statistical blocks due to being at the corner of the texture. A single statistical block cannot cover this, and each texel in the group needs to be counted as a group of texels. Therefore, three additional statistical block information is returned, and sub_area_count = 3. Texture address processing module 2 determines that sub_area_count = 3 and sub_area_id = 0, sends the UV coordinates of p0t0, clears the coordinates of p0t1 / p0t2 / p0t3 to 0, and sends area_count, sub_area_count, and sampler feedback flag to texture address parsing and decompression module 3. The texel distribution is shown in Figure 10.

[0064] The texture address parsing and decompression module 3 transparently transmits the received data to the texture filtering module 4 .

[0065] After receiving the information, the texture filtering module 4 sets the single texel p0t0 as a group of texels, which is marked in dark gray in Figure 10. The texture filtering module 4 obtains the starting point of the texel p0t0, determines the alignment block where the starting point is located (the 8×4 block (block_x=0, block_y=0) with (0, 0) as the starting point in Figure 10) and calculates the position offset of the starting point of the texel p0t0 relative to the starting point of the alignment block. As can be seen from Figure 10, the position offsets region_offset_x and region_offset_y are both 0 at this time. The texture filtering module 4 further sets an 8×4 statistical block 0 with the same starting point as the texel p0t0, which is marked in light gray in Figure 10 and includes the texel p0t0 therein. The 32-bit position mask information is calculated according to the rotation layout, and area_count=1, sub_area_count=3 and the position mask information are returned to shader 1 together with the starting point of statistical block 0 in the alignment block (block_x=0, block_y=0) with the starting point of (0, 0) and the position offset of the starting point of statistical block 0 relative to the starting point of the alignment block.

[0066] When shader 1 receives area_count=1 and sub_area_count=3 returned when area_id=0, shader 1 will again issue commands with sub_area_id=1, 2, and 3. In this case, similar operations as p0t0 are performed for each of the remaining three groups of texels p0t1, p0t2, and p0t3. For example, when sub_area_id=1, the texture filtering module 4 obtains the starting point of the texel p0t1, determines the alignment block where the starting point is located (the 8×4 block (block_x=1, block_y=0) with (8,0) as the starting point in Figure 10) and calculates the position offset of the starting point of the texel p0t1 relative to the starting point of the alignment block. As can be seen from Figure 10, the position offsets region_offset_x=7 and region_offset_y=0 at this time. The texture filter module 4 further sets an 8×4 statistics block 1 having the same starting point as the texel p0t1, which is marked in light gray in FIG10 and includes the texel p0t1 therein, and returns the position mask information, the starting point of the statistics block 1 in the alignment block (block_x=1, block_y=0) with the starting point (8, 0), and the position offset of the starting point of the statistics block 1 relative to the starting point of the alignment block to the shader 1. When sub_area_id=2, the texture filter module 4 obtains the starting point of the texel p0t2, determines the alignment block in which the starting point is located (the 8×4 block (block_x=0, block_y=1) with the starting point (0, 4) in FIG10), and calculates the position offset of the starting point of the texel p0t2 relative to the starting point of the alignment block. As can be seen from FIG10, the position offsets region_offset_x=0 and region_offset_y=3 at this time. The texture filter module 4 further sets an 8×4 statistics block 2 having the same starting point as the texel p0t2, which is marked in light gray in FIG10 and includes the texel p0t2 therein. The texture filter module 4 then returns the position mask information, the starting point of the statistics block 2 in the alignment block (block_x=0, block_y=1) with a starting point of (0, 4), and the position offset of the starting point of the statistics block 2 relative to the starting point of the alignment block to the shader 1. When sub_area_id=3, the texture filter module 4 obtains the starting point of the texel p0t3, determines the alignment block in which the starting point is located (the 8×4 block (block_x=1, block_y=1) with a starting point of (8, 4) in FIG10), and calculates the position offset of the starting point of the texel p0t3 relative to the starting point of the alignment block. As can be seen from FIG10, the position offsets region_offset_x=7 and region_offset_y=3 at this time.The texture filtering module 4 further sets a statistics block 3 having the same starting point as the texel p0t3, which is marked in light gray in FIG10 and includes the texel p0t3 therein, and returns the position mask information, the starting point of the statistics block 3 in the alignment block (block_x=1, block_y=1) with (8, 4) as the starting point, and the position offset of the starting point of the statistics block 3 relative to the starting point of the alignment block to the shader 1. In this way, it is only necessary to return the information of the starting points of the four statistics blocks 0 to 3 in the corresponding four alignment blocks and the four statistics blocks 0 to 3 with the position offsets relative to the starting points of the corresponding alignment blocks to provide the position information of all texels associated with the pixel p0.

[0067] When repeated edges appear, the texture address processing module 2 will set the required sub_area_count and the texel coordinates that need to be sent for the current sub_area_id according to the interval of the texture coordinates. Table 1 below shows the coordinate sending order of the texture address processing module 2 at different sub_area_counts.

[0068] Table 1

[0069] Since the statistical information of the statistical block can be returned by repeatedly utilizing the sampler feedback command, the number of additional returns can be reduced, thereby improving the operation efficiency.

[0070] In some embodiments, the fourth sampling mode may be: repeated edges, trilinear filtering, and no anisotropic filtering. The command issued by shader 1 is as follows: SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,0)

[0071] When area_id = 0, texture address processing module 2 calculates lod = 0.3, lod_ratio = 2, AF_ratio = 1, and area_count = lod_ratio × AF_ratio = 2. Taking p0 as an example, with area_id = 0, the texture processing module obtains the set of texels (p0t0, p0t1, p0t2, p0t3) associated with pixel p0 in the first-level texture space that need to be sampled based on the UV coordinates. Since (t1.u - t0.u > 8) && (t2v - t0.v > 4) for p0, sub_area_count = 3. Based on sub_area_count and sub_area_id, the corresponding texel address, area_count, sub_area_count, and sampler feedback flag are sent to texture address resolution and decompression module 3.

[0072] The texture address parsing and decompression module 3 transparently transmits the received data to the texture filtering module 4 .

[0073] After receiving the information, texture filter module 4 sets the single texel p0t0 as a group of texels, similar to the situation shown in Figure 10, with the group of texels marked in dark gray. Texture filter module 4 obtains the starting point of texel p0t0, determines the alignment block in which the starting point is located, calculates the position offset of texel p0t0's starting point relative to the starting point of the alignment block, sets an 8×4 statistics block 0 with the same starting point as texel p0t0, similar to the situation shown in Figure 10, with the statistics block marked in light gray and including texel p0t0. 32-bit position mask information is calculated based on the rotated layout, and the position mask information, along with area_count = 1, sub_area_count = 3, and the starting point of statistics block 0 in the alignment block (block_x = 0, block_y = 0) with a starting point of (0, 0), and the position offset of the starting point of statistics block 0 relative to the starting point of the alignment block, is returned to shader 1. The processing of the remaining texels is the same as in the third sampling method.

[0074] When shader 1 receives area_count = 2 and sub_area_count = 3 when area_id = 0, shader 1 will send commands for sub_area_id = 1, 2, and 3 again. SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,1) SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,2) SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,3)

[0075] When sub_area_id = 1, 2, or 3, because area_id = 0, the texture address processing module 2 behaves the same as if area_id = 0, selecting and sending the coordinates in the first-level texture space based on sub_area_id. After receiving the coordinates, the texture filtering module 4 determines the alignment block where the starting point of the texel is located, calculates the position offset of the starting point relative to the starting point of the alignment block, sets a statistical block whose starting point is the same as the starting point of the texel, locates the starting point of the statistical block in the determined alignment block, and returns the position offset of the starting point of the statistical block relative to the starting point of the alignment block, along with the position mask information, to the shader 1.

[0076] When sub_area_id = sub_area_count, shader 1 will exit the loop and continue to send the next area_id. SMP.footprint(t#id,s#id,u,v,s,expected_region_size,1,0)

[0077] When area_id = 1 and sub_area_id = 0, texture address processing module 2 calculates the coordinates of the second-level texture space and calculates sub_area_count = 0 for the second-level texture space. Texture address processing module 2 issues the coordinates and lod value of the second-level texture space. The coordinate distribution is shown in Figure 11. The group of texels (p0t0, p0t1, p0t2, p0t3) associated with the pixel in the second-level texture space are marked in dark gray in Figure 11.

[0078] Texture filtering module 4 receives the information, sets the single texel p0t0 as a group of texels, obtains the starting point of texel p0t0 (marked in dark gray) in the second-level texture space, determines the alignment block in which the starting point is located, and calculates the position offset of the starting point of texel p0t0 relative to the starting point of the alignment block (as shown in Figure 11, region_offset_x and region_offset_y are both 0). Texture filtering module 4 further sets an 8×4 statistical block in the second-level texture space that has the same starting point as the group of texels. In Figure 11, the statistical block is marked in light gray and includes texel p0t0. In this case, even if other texels p0t1, p0t2, and p0t3 are distributed in the corners of the texture, because the single 8×4 statistical block can cover all texels p0t0, p0t1, p0t2, and p0t3, only one statistical block of information needs to be returned, indicating the starting point of the statistical block in the determined alignment block and the position offset of the starting point of the statistical block relative to the starting point of the alignment block. 32-bit position mask information is calculated based on the rotated layout, and this information and area_count=2 are returned together with the information of the determined statistics block to shader 1. Therefore, since the statistical information of the statistics block can be returned by reusing the sampler feedback command, the number of additional returns is reduced, thereby improving the running efficiency.

[0079] In some embodiments, the fifth sampling mode may be: repeated edges, anisotropic filtering, and no trilinear filtering, as shown in Figure 12. The command issued by shader 1 is as follows: SMP.footprint(t#id,s#id,u,v,s,expected_region_size,0,0)

[0080] When area_id = 0, texture address processing module 2 calculates lod_ratio = 1, AF_ratio = 8x, and area_count = lod_ratio × AF_ratio = 8. Taking p0 as an example, with area_id = 0, it first calculates p0s0 for the set of texels sampled by sampling unit s0 in the texture space and calculates sub_area_count = 0. Texture address processing module 2 sends the calculated texels, area_count, sub_area_count, and sampler feedback flag to texture address resolution and decompression module 3. The coordinate distribution is shown in Figure 12.

[0081] The texture address parsing and decompression module 3 transparently transmits the sampler feedback data to the texture filtering module 4.

[0082] After receiving the information, the texture filtering module 4 obtains the starting point of the group of texels p0s0, determines the 8×4 alignment block where the starting point is located (with (0, 0) as the starting point), and calculates the position offset of the starting point of the texel group p0s0 relative to the starting point of the alignment block (region_offset_x=3, region_offset_y=2). The texture filtering module 4 further sets an 8×4 statistics block with the same starting point as the texel group p0s0, which includes the texel group p0s0. The texture filtering module 4 calculates the 32-bit position mask information based on the rotation layout and returns it to the shader 1 together with area_count=8 and sub_area_count=0, along with the starting point of the statistics block in the alignment block with the starting point (0, 0) and the position offset of the starting point of the statistics block relative to the starting point of the alignment block.

[0083] When shader 1 receives area_count = 8 when area_id = 0, shader 1 will send area_id = 1, 2, 3, 4, 5, 6, 7 again. SMP.footprint(t#id,s#id,u,v,s,expected_region_size,1-6,0)

[0084] When area_id = 1, 2, 3, 4, 5, 6, the texture address processing module 2 calculates the texels sampled by each sampling unit s1, s2, s3, s4, s5, and s6 in turn and sends them to the texture filtering module 4. The texture filtering module 4 determines the position offset of the corresponding alignment block and the 8×4 statistics block and returns area_count = 8. SMP.footprint(t#id, s#id, u, v, s, expected_region_size, 7, 0)

[0085] When area_id = 7, due to the presence of repeated edges (sampled texels exist at the leftmost and rightmost edges of Figure 12), the texel p0s7 sampled by sampling unit s7 of texture address processing module 2 includes two groups of texels, namely, a group of texels at the left edge of Figure 12 and a group of texels at the right edge. In this case, sub_area_count is calculated to be 1, and area_count = 8. Texture address processing module 2 first calculates the first group of texels based on sub_area_id and sub_area_count, and sends it along with area_count, sub_area_count, and sampler feedback flag to texture address parsing and decompression module 3 and texture filtering module 4.

[0086] After receiving the information, the texture filter module 4 obtains the starting point of the first group of texels of p0s7, determines the alignment block in which the starting point is located (with (24, 0) as the starting point), and calculates the position offset of the starting point of the first group of texels relative to the starting point of the alignment block (region_offset_x=0, region_offset_y=2). The texture filter module 4 further sets an 8×4 statistics block with the same starting point as the first group of texels, calculates 32-bit position mask information based on the rotation layout, and returns it to the shader 1 along with area_count=8 and sub_area_count=0, along with the starting point of the statistics block in the alignment block with the starting point of (24, 0) and the position offset of the starting point of the statistics block relative to the starting point of the alignment block (region_offset_x=0, region_offset_y=2).

[0087] When shader 1 receives sub_area_count>0, it will issue the command again. SMP.footprint(t#id,s#id,u,v,s,expected_region_size,7,1)

[0088] In response to the received instruction, texture filter module 4 obtains the starting point of the second group of texels in p0s7, determines the alignment block in which the starting point is located (with (0, 0) as the starting point), and calculates the position offset of the starting point of the second group of texels relative to the starting point of the alignment block (region_offset_x=0, region_offset_y=2). Texture filter module 4 further sets an 8×4 statistical block with the same starting point as the second group of texels, and returns the starting point of the statistical block in the alignment block with the starting point of (0, 0) and the position offset of the starting point of the statistical block relative to the starting point of the alignment block (region_offset_x=0, region_offset_y=2) in a manner similar to that of the first group of texels in p0s7, and then terminates the process.

[0089] Therefore, since the statistical information of the statistical block can be returned by repeatedly utilizing the sampler feedback command and the number of additional returns can be reduced, the operation efficiency is improved.

[0090] As described above, after the sampler feedback command SMP.footprint is completed for all pixels, shader 1 updates the level of the original feedback map of each texture level. The updated result is shown in Figure 13.

[0091] By providing this result to the driver, texture loading can be optimized. In addition, if it is necessary to generate a minimum mapping level (minmipmap) based on this, the minimum mapping level of the texture can be generated by the GenerateMinmap function. The result is shown in Figure 14.

[0092] It is noted that although the above description uses an alignment block and a statistical block with a size of 8×4 as an example, it is clear to those skilled in the art that such a size is only an example and any alignment block and statistical block size such as 4×4, 4×6, 5×5, 6×6, 6×8, 8×8, etc. can be used, as long as such a size can cover a set of texels in the texture space.

[0093] In addition, according to the aforementioned third to fifth sampling methods, even if the texels associated with the pixel are discrete, the statistics of the sampled texels can be efficiently completed by adopting the embodiments of the present disclosure.

[0094] Figure 15 is a flowchart illustrating an example of using a statistics block to return the locations of sampled texels according to the present disclosure. As shown in Figure 15 , at step 1501, the texture shader 1 issues a sampler feedback command to the texture sampler, requesting the return of the locations of at least one group of texels in a texture space associated with a pixel at a level of the texture. At step 1502, the texture address processing module 2 of the texture sampler receives the sampler feedback command and samples at least one group of texels in the texture space, each group of texels comprising at least one texel. The texture address processing module 2 then transmits the level information and coordinate information of the at least one group of texels to the texture filtering module 4. At step 1503, the texture filtering module 4 sets a statistics block based on the level information and coordinate information, and then counts an area of ​​the texture space corresponding to the statistics block size. At step 1504, the texture filtering module 4 obtains the starting point of one of the at least one group of texels, ensuring that the statistics block has the same starting point as the corresponding group of texels and that the group of texels is included within the statistics block size. In 1505, the texture filtering module 4 performs statistics at least once, and each time the statistics are returned to the texture shader, indicating in which alignment block the starting point of the statistics block is located in the densely aligned alignment blocks in the texture space, and the position offset of the starting point of the statistics block relative to the starting point of the alignment block in which it is located, completing the statistics of all sampled texels in the texture space and returning the texel position to the shader 1. In addition, for example, after the shader 1 confirms that the sampling of the current level of the texture is completed, similar processing as described above can be performed on other levels of the texture associated with the pixels to complete the sampling at all texture levels. In addition, for example, as described above for the texture address processing module 2 and the texture address sampler 4, different sampling methods such as anisotropic filtering, repeated edges and trilinear filtering can be used when sampling the texture, and statistics are performed on the addresses of multiple groups of texels obtained under different sampling methods. Needless to say, the details described for the device embodiment of the present disclosure are also applicable to the embodiments of the method for implementing the present disclosure.

[0095] In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over a computer-readable medium as one or more commands, instructions, or codes and executed by a hardware-based processing unit. A computer-readable medium may include a computer-readable storage medium corresponding to a tangible medium such as a data storage medium, or a communication medium including, for example, any medium that facilitates the transfer of a computer program from one place to another according to a communication protocol. In this manner, a computer-readable medium may generally correspond to (1) a tangible, non-transitory computer-readable storage medium, or (2) a communication medium such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the implementations described in this application. A computer program product may include a computer-readable medium.

[0096] In addition, an embodiment of the present disclosure further provides a chip, the chip including a programmable logic circuit and / or program instructions, which, when executed, is used to implement the above method. Optionally, the chip may be a GPU chip or a graphics card.

[0097] In addition, an embodiment of the present disclosure further provides a computer device, which includes a processor and a memory, wherein a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the above method.

[0098] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program, and the computer program is loaded and executed by a processor to implement the above method.

[0099] The terms used in the description of the implementation in this article are merely for the purpose of describing a particular implementation, and are not intended to limit the scope of the claims. As used in the description of the implementation and the appended claims, "one," "the," and "said" are also intended to include both singular and plural forms, unless the context clearly indicates otherwise. It will also be understood that the terms "and / or" used in this article refer to and encompass any and all possible combinations of one or more associated listed items. It will be further understood that the terms "comprises" and / or "comprising" when used in this specification specify the presence of declared features, elements, and / or components, but do not exclude the presence or addition of one or more other features, elements, components, and / or groups thereof.

[0100] The description of the present application is provided for the purpose of illustration and description, and is not intended to be exhaustive or to limit the present disclosure to the disclosed form. Many modifications, variations and alternative implementations will be apparent to those of ordinary skill in the art, having benefited from the teachings presented in the foregoing description and the associated drawings. The embodiments are selected and described in order to best explain the principles and practical applications of the present disclosure, and to enable other persons skilled in the art to understand the present disclosure for various implementations, and to best utilize the basic principles and various implementations with various modifications when suitable for the intended specific use. Therefore, it is to be understood that the scope of the claims is not limited to the specific examples of the disclosed implementations, and that modifications and other implementations are intended to be included within the scope of the appended claims.

Claims

1. A texture sampler, comprising a texture address processing module and a texture filtering module; The texture address processing module samples at least one set of texels in a level of the texture associated with a pixel, each set of texels including at least one texel, and the texture address processing module transmits the level information and coordinate information of the at least one set of texels to the texture filtering module; The texture filtering module sets a statistical block according to the level information and the coordinate information, and each time it statistics an area of the size of the statistical block in the texture space; Among them, Each time the texture filtering module statistics, it obtains the starting point of a set of texels in the at least one set of texels, makes the statistical block have the same starting point as the corresponding set of texels and makes the set of texels included within the size of the statistical block. The texture filtering module performs at least one statistics, and each time the statistics returns the alignment block where the starting point of the statistical block is located and the position offset of the starting point of the statistical block relative to the starting point of the alignment block where it is located. The alignment blocks are closely arranged and aligned in a manner that fills the texture space.

2. The texture sampler according to claim 1, wherein, All texels associated with the pixel are included in one set of texels.

3. The texture sampler according to claim 1 or 2, wherein The texture address processing module samples in an anisotropic filtering manner or in a trilinear filtering manner or combines these two filtering methods for sampling.

4. The texture sampler according to claim 3, wherein, The texture address processing module samples in a repeating edge manner.

5. The texture sampler according to claim 4, wherein, The at least one set of texels includes a set of texels at the corners of the texture.

6. The texture sampler according to claim 5, wherein The number of times the texture filtering module returns the statistical block information is determined by at least one of edge repetition, anisotropic filtering, and trilinear filtering.

7. The texture sampler according to claim 6, wherein, The level is one of at least one level of the texture associated with the pixel, and the at least one level is determined by the texture address processing module sampling in a trilinear filtering manner.

8. The texture sampler according to claim 7, wherein The texture address processing module instructs the texture filtering module to return the statistical block information for the at least one level.

9. The texture sampler according to claim 8, wherein, The texture sampler further includes a texture address parsing and decompression module, which receives notifications and instructions from the texture address processing module and transmits them transparently to the texture filtering module.

10. A texture shader that issues a sampler feedback command to the texture sampler according to any one of claims 1 to 9. The sampler feedback command causes the texture sampler to return the position information of a set of texels associated with a pixel in the texture space. The texture shader repeatedly issues the sampler feedback command to obtain the coordinates of the texels associated with the pixel in at least one level of the texture in the texture space, and uses these coordinates to update at least one level of the original feedback mapping of the texture.

11. The texture shader according to claim 10, wherein, The at least one level of the original feedback mapping is obtained by increasing the texture space coordinate granularity of the corresponding texture level by a specified ratio.

12. A method for implementing texture feedback, comprising the following steps: The texture shader issues a sampler feedback command to the texture sampler for returning the position of at least one set of texels in a level of the texture associated with a pixel; The texture address processing module of the texture sampler receives the sampler feedback command, samples at least one set of texels in the level, each set of texels including at least one texel, and the texture address processing module transmits the level information and coordinate information of the at least one set of texels to the texture filtering module of the texture sampler; The texture filtering module sets a statistical block according to the level information and the coordinate information, and each time it statistics an area of the size of the statistical block in the texture space. Wherein, each time the texture filtering module statistics, it obtains the starting point of a set of texels in the at least one set of texels, makes the statistical block have the same starting point as the corresponding set of texels and makes the set of texels be included within the size of the statistical block. The texture filtering module performs at least one statistics, and each time it statistics, it returns to the texture shader the alignment block where the starting point of the statistical block is located and the position offset of the starting point of the statistical block relative to the starting point of the alignment block where it is located. The alignment blocks are densely packed and aligned in a way that fills the texture space.

13. The method according to claim 12, wherein, The texture address processing module samples all the texels associated with the pixel in one set of texels.

14. The method according to claim 12 or 13, wherein, The texture address processing module samples in an anisotropic filtering mode or in a trilinear filtering mode or combines these two filtering modes for sampling.

15. The method according to claim 14, wherein, The texture address processing module samples in a repeating edge mode.

16. The method according to claim 15, wherein, The at least one set of texels includes a set of texels at the corners of the texture.

17. The method according to claim 16, wherein, The texture address processing module determines the number of times the texture filtering module returns statistical block information according to at least one of edge repetition, anisotropic filtering, and trilinear filtering.

18. The method according to claim 17, wherein, The level is one of at least one level of the texture associated with the pixel, and the texture address processing module samples in a trilinear filtering mode to determine the at least one level of the texture associated with the pixel.

19. The method according to claim 18, wherein, The texture address parsing and decompression module of the texture sampler receives the notifications and instructions from the texture address processing module and transmits them transparently to the texture filtering module.

20. A computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by one or more processors, implements the method for implementing texture feedback according to any one of claims 12 to 19.

21. A chip, the chip includes programmable logic circuits and / or program instructions, and when the chip runs, it is used to implement the method for implementing texture feedback according to any one of claims 12 to 19.

22. A computer device, the computer device includes a processor and a memory, and a computer program is stored in the memory, and the computer program is loaded and executed by the processor to implement the method for implementing texture feedback according to any one of claims 12 to 19.

23. A computer program product, the computer program product includes a computer program, and the computer program is loaded and executed by a processor to implement the method for implementing texture feedback according to any one of claims 12 to 19.

Citation Information

Patent Citations

  • Texture samplers and methods for implementing texture feedback

    CN118096847B

  • GPU multi-thread texture mapping SystemC modeling structure

    CN106683171A

  • Cache architecture for efficiently accessing texture data using buffers

    CN107153617A

  • Device and method for realizing texture sampling in GPU (Graphics Processing Unit)

    CN115409882A

  • Texture sampler and method for realizing texture feedback

    CN118096847A