Search

CN-122023105-A - Sampler texture feedback method, graphics processor, electronic device and storage medium

CN122023105ACN 122023105 ACN122023105 ACN 122023105ACN-122023105-A

Abstract

The disclosure provides a sampler texture feedback method, a graphics processor, electronic equipment and a storage medium, and relates to the technical field of graphics processing. The method comprises the steps of receiving and analyzing a feedback instruction of a sampler through a shader processing module to obtain texture sampling data for feedback processing, performing texture space mapping by the texture sampling module based on a texture sampling path multiplexing texture sampling data to generate a texture level data storage address, and writing a request to update a target cache unit by using the texture address with a feedback zone bit to enable the target cache unit to record the service condition of a corresponding texture area and level. According to the technical scheme, under the condition that independent hardware and high instruction cost are not increased, texture access statistics and texture sampling processes are completed cooperatively on a hardware pipeline, so that the generation efficiency of texture feedback data can be improved, the access pressure of a feedback path can be reduced, and the accuracy of the service condition of a texture level can be enhanced.

Inventors

  • Request for anonymity
  • Request for anonymity

Assignees

  • 摩尔线程智能科技(北京)股份有限公司

Dates

Publication Date
20260512
Application Date
20251226

Claims (10)

  1. 1. A sampler texture feedback method, applied to a graphics processor, the graphics processor at least comprising a shader processing module, a texture sampling module, and a target cache unit, the method comprising: Receiving a sampler feedback instruction through the shader processing module, and determining texture sampling data according to the sampler feedback instruction; generating, by the texture sampling module, a texture level data storage address based on the sampler feedback instruction and the texture sampling data; And initiating a texture address writing request to the target cache unit based on the texture level data storage address through the texture sampling module, so that the target cache unit executes writing operation according to the texture address writing request to obtain texture feedback graph data containing texture level use conditions.
  2. 2. The method of claim 1, wherein the texture sample data comprises texture sample coordinates and texture level data; The receiving, by the shader processing module, a sampler feedback instruction, and determining texture sampling data according to the sampler feedback instruction, including: the generated sampler feedback instruction is issued to the shader processing module, so that the sampler feedback instruction is received through the shader processing module; And determining the texture sampling coordinates and the texture level data from the received sampler feedback instruction through the shader processing module.
  3. 3. The method of claim 2, wherein the determining, by the shader processing module, the texture sample coordinates and the texture level data from the sampler feedback instruction comprises: analyzing the feedback instruction of the sampler by the shader processing module to obtain texture normalized coordinates and texture region sizes; And calculating and counting based on the texture normalized coordinates and the texture region sizes to obtain texture sampling coordinates corresponding to each texture region in a texture space, and calculating and counting through the texture sampling coordinates to obtain the texture level data corresponding to each texture region.
  4. 4. The method of claim 1, wherein the texture sample data comprises texture level data, wherein the generating, by the texture sample module, a texture level data storage address based on the sampler feedback instruction and the texture sample data comprises: Multiplexing a coordinate calculation path for texture color sampling in the texture sampling module through the response of the texture sampling module to the feedback instruction of the sampler, and performing texture space mapping on texture sampling coordinates contained in the texture sampling data to obtain texture level coordinates of each texture region in a texture level space; and calculating a texture region storage address which needs to be fed back by the current texture level in the texture level data according to the texture level coordinates, and generating the texture level data storage address based on the texture region storage address.
  5. 5. The method of claim 1, wherein the initiating, by the texture sampling module, a texture address write request to the target cache unit based on the texture level data storage address comprises: Converting a texture data reading request corresponding to the texture level data storage address into a texture address writing request through the texture sampling module, and adding a texture feedback flag bit into the texture address writing request; And sending the texture address writing request carrying the texture feedback zone bit to the target cache unit by taking the maximum number of the texture pixels written each time as a unit.
  6. 6. The method of claim 5, wherein causing the target cache unit to perform a write operation according to the texture address write request to obtain texture feedback map data including texture level usage comprises: and receiving the texture address writing request through the target cache unit, responding to a texture feedback zone bit in the texture address writing request, and adopting a feedback processing mode different from a common data writing mode according to the texture feedback zone bit so as to execute the writing operation of texture data according to the data length of the texture pixels with the target number, thereby obtaining texture feedback graph data containing the service condition of a texture level.
  7. 7. The method of claim 6, wherein after receiving the texture address write request by the target cache unit, further comprising: Merging written texture data corresponding to a plurality of texture address writing requests pointing to the same cache line through the target cache unit; and when the cache line is replaced, writing the combined cache line data back to a next-stage storage medium so as to update the use state of the corresponding texture area in the texture feedback graph data.
  8. 8. A graphics processor, comprising: the shader processing module is used for receiving the feedback instruction of the sampler and determining texture sampling data according to the feedback instruction of the sampler; The texture sampling module is in communication connection with the shader processing module and is used for generating a texture level data storage address based on the sampler feedback instruction and the texture sampling data and initiating a texture address writing request to a target cache unit based on the texture level data storage address; The target cache unit is in communication connection with the texture sampling module and is used for executing writing operation according to the texture address writing request so as to obtain texture feedback graph data containing the use condition of a texture level.
  9. 9. An electronic device, comprising: Processor, and A memory having stored thereon computer readable instructions which, when executed by the processor, implement the sampler texture feedback method of any one of claims 1 to 7.
  10. 10. A computer readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the sampler texture feedback method of any one of claims 1 to 7.

Description

Sampler texture feedback method, graphics processor, electronic device and storage medium Technical Field The disclosure relates to the technical field of graphics processing, and in particular relates to a sampler texture feedback method, a graphics processor, electronic equipment and a storage medium. Background In the rendering flow of a graphics processor (Graphics Processing Unit, GPU), texture mapping is a key technique to generate realistic images. In order to efficiently manage mass texture data, the industry often adopts a block resource technology to dynamically load the texture data required by the current visual area into a video memory. However, with the continuous improvement of the texture precision and the size requirements of the application scene, the amount of texture data is rapidly increased, and how to accurately predict and load the texture data actually needed to be used, so as to avoid the waste of the video memory space and improve the data loading efficiency, which is a problem to be solved urgently. To this end, new graphics application programming interfaces (Application Programming Interface, APIs) such as DirectX 12, etc., introduce Sampler Feedback (Sampler Feedback) features. The characteristic aims to feed back the texture region and detailed level (MIPMAP LEVEL) information thereof which are actually accessed in the texture sampling process through the graphic processor, thereby providing basis for the driver or the application program to load the texture data more accurately next time and optimizing the video memory occupation. However, in order to collect feedback information, the current feedback scheme of the sampler generally needs to call more instructions in the shader processing module and cooperate with circulation logic, which brings a heavy processing burden to the shader processing module. Meanwhile, in the texture sampling module, a plurality of sub-modules are often required to be coordinated to participate in processing, so that the complexity of hardware implementation is high, and more hardware resources are occupied. Thus, current sampler feedback implementations are in need of improved optimization in terms of efficiency and hardware cost. It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art. Disclosure of Invention An object of the embodiments of the present disclosure is to provide a texture feedback method of a sampler, a graphics processor, an electronic device, and a computer readable storage medium, so that texture access statistics and texture sampling processes can be cooperatively completed on a hardware pipeline without increasing independent hardware and high instruction overhead, thereby improving the generation efficiency of texture feedback data, reducing the access pressure of a feedback path, and enhancing the accuracy of the usage situation of a texture hierarchy. Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure. According to a first aspect of an embodiment of the present disclosure, there is provided a sampler texture feedback method applied to a graphics processor, where the graphics processor includes at least a shader processing module, a texture sampling module, and a target cache unit, the method including: Receiving a sampler feedback instruction through the shader processing module, and determining texture sampling data according to the sampler feedback instruction; generating, by the texture sampling module, a texture level data storage address based on the sampler feedback instruction and the texture sampling data; And initiating a texture address writing request to the target cache unit based on the texture level data storage address through the texture sampling module, so that the target cache unit executes writing operation according to the texture address writing request to obtain texture feedback graph data containing texture level use conditions. In some example embodiments of the present disclosure, based on the foregoing, the texture sample data includes texture sample coordinates and texture level data; The receiving, by the shader processing module, a sampler feedback instruction, and determining texture sampling data according to the sampler feedback instruction, including: the generated sampler feedback instruction is issued to the shader processing module, so that the sampler feedback instruction is received through the shader processing module; And determining the texture sampling coordinates and the texture level data from the received sampler feedback instruction through the shader processing module. In some example embodiments of the present disclosure, based on the foreg