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

By receiving floating-point texture coordinates and converting multiple sets of precision parameters into fixed-point texture coordinates, and selecting the texture coordinate with the largest precision difference as the result, the problem of low efficiency and high cost in texture coordinate processing in the prior art is solved, realizing efficient and low-cost precision adjustment and meeting hardware requirements.

CN120510266BActive Publication Date: 2025-12-26MOORE THREADS TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510983800.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2025-12-26
Estimated Expiration
2045-07-16

AI Technical Summary

Technical Problem

In the current process of graphics rendering by graphics processors, the processing efficiency of texture coordinates is low and the cost is high. It requires multiple iterations to adjust the precision parameters, resulting in excessive data processing and manual costs, and it is impossible to quickly locate the precision problem.

Method used

By receiving floating-point texture coordinates and multiple sets of precision parameters, converting them into multiple fixed-point texture coordinates, determining the precision difference between each texture coordinate and the reference value, and finally selecting the texture coordinate with the largest precision difference as the processing result, the software model architecture is simplified and the precision parameters are dynamically adjusted to meet hardware design requirements.

Benefits of technology

It reduces the number of iterations, lowers data processing and labor costs, improves the processing efficiency of texture coordinates, simplifies the operation of software models, and ensures that accuracy requirements are met quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120510266B_ABST
    Figure CN120510266B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of computers, and provides a texture coordinate processing method and device, electronic equipment and storage medium. The method comprises: receiving at least one first texture coordinate and a plurality of sets of precision parameters, the first texture coordinate being a floating-point number; for each first texture coordinate, converting the first texture coordinate using the plurality of sets of precision parameters to obtain a plurality of second texture coordinates, the second texture coordinates being fixed-point numbers; for the plurality of second texture coordinates obtained by converting each first texture coordinate, determining the precision gap between each second texture coordinate and a reference value corresponding to the second texture coordinate, and determining the second texture coordinate with the largest precision gap with the reference value as the processed texture coordinate. The method can reduce the number of iterations, reduce data processing costs, and improve the processing efficiency of texture coordinates.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a texture coordinate processing method and device, electronic equipment and storage medium. BACKGROUND

[0002] In the process of graphics rendering of a graphics processing unit (GPU), a hardware is simulated by a software model to calculate texture coordinates, and the simulation needs to be bit-accurate to provide a reference for the hardware design and architecture definition of the GPU.

[0003] In order to improve the calculation performance, the texture coordinates of the floating-point numbers are usually processed to represent the texture coordinates in the form of fixed-point numbers. The process may involve conversion of floating-point numbers to fixed-point numbers and rounding operations. The accuracy of the processed texture coordinates will directly affect the quality and accuracy of image rendering. In general, the higher the accuracy, the greater the hardware cost, and the lower the accuracy, the test requirements cannot be met. Therefore, the accuracy of the processed texture coordinates needs to be accurately controlled to ensure that the GPU can meet the test requirements, the chip area and power consumption requirements.

[0004] In the prior art, multiple iterations are usually needed to determine the appropriate accuracy. Each iteration includes reconstruction of the software model code, testing using a graphics API test set, adjusting the accuracy according to the test results, etc. This requires a large amount of data processing cost, and also reduces the processing efficiency of the texture coordinates. SUMMARY

[0005] Therefore, the present disclosure provides a texture coordinate processing method and device, electronic equipment and storage medium. The method can reduce the number of iterations, reduce the data processing cost, and improve the processing efficiency of the texture coordinates.

[0006] According to an aspect of the present disclosure, a texture coordinate processing method is provided, which includes: receiving at least one first texture coordinate and a plurality of sets of accuracy parameters, the first texture coordinate being a floating-point number; for each first texture coordinate, converting the first texture coordinate using the plurality of sets of accuracy parameters to obtain a plurality of second texture coordinates, the second texture coordinates being fixed-point numbers; for the plurality of second texture coordinates obtained by converting each first texture coordinate, determining the accuracy gap between each second texture coordinate and a reference value corresponding to the second texture coordinate, and determining the second texture coordinate with the largest accuracy gap with the reference value as the processed texture coordinate.

[0007] In a possible implementation, each set of accuracy parameters includes an integer number of bits and a decimal number of bits.

[0008] In a possible implementation, the first texture coordinate comprises an exponent bit, a mantissa bit and a sign bit, and the converting the first texture coordinate using the plurality of sets of precision parameters respectively comprises: determining a mantissa corresponding to the first texture coordinate according to the mantissa bit and the sign bit of the first texture coordinate when converting the first texture coordinate using any one set of precision parameters; determining a reference value corresponding to the set of precision parameters and the first texture coordinate according to the number of bits of the mantissa bit, the exponent bit and the number of decimal digits included in the set of precision parameters; converting the mantissa using the set of precision parameters to obtain a first fixed-point number; determining a second fixed-point number according to the first fixed-point number and a texture mapping parameter; and determining the second texture coordinate according to the reference value and the second fixed-point number.

[0009] In a possible implementation, all reference values corresponding to the same first texture coordinate have the same true value.

[0010] In a possible implementation, when the first texture coordinate is a width coordinate, the texture mapping parameter is a width mapping parameter; when the first texture coordinate is a height coordinate, the texture mapping parameter is a height mapping parameter; and when the first texture coordinate is a depth coordinate, the texture mapping parameter is a depth mapping parameter.

[0011] In a possible implementation, the reference value corresponding to any one set of precision parameters and any one first texture coordinate is equal to the maximum value that can be expressed by a Y-bit binary number, where Y is equal to the number of bits of the mantissa bit of the first texture coordinate minus the exponent bit of the first texture coordinate plus the number of decimal digits included in the set of precision parameters, and Y is a positive integer.

[0012] In a possible implementation, the determining the precision gap between each second texture coordinate and a reference value corresponding to the second texture coordinate comprises: performing a rounding operation on the reference value to retain integer bits and X decimal bits of the reference value, where X is the number of decimal digits of the second texture coordinate, and X is a positive integer; and taking the numerical gap between the second texture coordinate and the reference value as the precision gap between the second texture coordinate and the reference value corresponding to the second texture coordinate.

[0013] According to another aspect of the present disclosure, provided is a device for processing texture coordinates, the device comprising: a receiving module configured to receive at least one first texture coordinate and a plurality of sets of precision parameters, the first texture coordinate being a floating-point number; a converting module configured to, for each first texture coordinate, convert the first texture coordinate using the plurality of sets of precision parameters respectively to obtain a plurality of second texture coordinates, the second texture coordinates being fixed-point numbers; and a determining module configured to, for each first texture coordinate, determine an accuracy gap between each second texture coordinate and a reference value corresponding to the second texture coordinate, and determine the second texture coordinate with the largest accuracy gap from the reference value as a processed texture coordinate.

[0014] In a possible implementation, each set of precision parameters comprises an integer bit number and a decimal bit number.

[0015] In a possible implementation, the first texture coordinate comprises an exponent bit, a mantissa bit and a sign bit, and the converting the first texture coordinate using the plurality of sets of precision parameters respectively comprises: when converting the first texture coordinate using any set of precision parameters, determining a mantissa corresponding to the first texture coordinate according to the mantissa bit and the sign bit of the first texture coordinate; determining a reference value corresponding to the set of precision parameters and the first texture coordinate according to a bit number of the mantissa bit, the exponent bit and a decimal bit number included in the set of precision parameters; converting the mantissa using the set of precision parameters to obtain a first fixed-point number; determining a second fixed-point number according to the first fixed-point number and a texture mapping parameter; and determining the second texture coordinate according to the reference value and the second fixed-point number.

[0016] In a possible implementation, all reference values corresponding to the same first texture coordinate have the same true value.

[0017] In a possible implementation, when the first texture coordinate is a width coordinate, the texture mapping parameter is a width mapping parameter; when the first texture coordinate is a height coordinate, the texture mapping parameter is a height mapping parameter; and when the first texture coordinate is a depth coordinate, the texture mapping parameter is a depth mapping parameter.

[0018] In a possible implementation, the reference value corresponding to any set of precision parameters and any first texture coordinate is equal to the largest number that can be expressed by a Y-bit binary number, Y being equal to a result of subtracting a bit number of an exponent bit of the first texture coordinate from a bit number of a mantissa bit of the first texture coordinate and adding a decimal bit number included in the set of precision parameters, Y being a positive integer.

[0019] In a possible implementation, the determining the precision difference between each second texture coordinate and the reference value corresponding to the second texture coordinate comprises: performing a rounding operation on the reference value, retaining integer bits and X decimal bits of the reference value, X being the number of decimal bits of the second texture coordinate, X being a positive integer; and taking the numerical difference between the second texture coordinate and the reference value as the precision difference between the second texture coordinate and the reference value corresponding to the second texture coordinate.

[0020] According to another aspect of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory, the processor executing the computer program to implement the steps of the above method.

[0021] According to another aspect of the present disclosure, a non-volatile computer readable storage medium is provided, having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the above method.

[0022] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, or a non-volatile computer readable storage medium carrying the computer program, the computer program being executed by a processor to implement the steps of the above method.

[0023] According to the method for processing texture coordinates provided in the embodiments of the present disclosure, by receiving at least one first texture coordinate and a plurality of sets of precision parameters, for each first texture coordinate, a plurality of second texture coordinates are obtained by respectively converting the first texture coordinate using the plurality of sets of precision parameters; the first texture coordinate is a floating-point number, and the second texture coordinate is a fixed-point number, so that the method realizes the conversion of the texture coordinates from the floating-point number to the fixed-point number, and realizes the conversion of multiple precisions; for each first texture coordinate, the precision difference between each second texture coordinate and the reference value corresponding to the second texture coordinate is determined, and the second texture coordinate with the largest precision difference from the reference value is determined as the processed texture coordinate. The second texture coordinate with the largest precision difference from the reference value also has the largest precision loss in the conversion process, so whether the precision of the processed texture coordinate meets the precision requirement can be determined according to whether the plurality of sets of precision parameters meet the requirement, and when the precision of the processed texture coordinate meets the requirement, it can be considered that the plurality of sets of precision parameters are precision parameters meeting the requirement, so the user can select appropriate precision parameters from the plurality of sets of precision parameters, without the need for iterative calculation, thereby reducing the number of iterative calculations, reducing the data processing cost, and improving the processing efficiency of the texture coordinates.

[0024] The method does not need to reconstruct the model code, and does not need to run a large number of test sets, so as to further reduce the data processing cost and improve the processing efficiency of the texture coordinates.

[0025] In the process of converting each first texture coordinate to obtain a plurality of second texture coordinates, different second texture coordinates can be converted in parallel, further improving the processing efficiency of the texture coordinates.

[0026] Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0027] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the present disclosure and serve to explain the principles of the present disclosure.

[0028] Figure 1 An exemplary application scenario of the processing method of the texture coordinates according to the embodiments of the present disclosure is shown.

[0029] Figure 2 A schematic diagram showing the flow of the processing method of the texture coordinates according to the embodiments of the present disclosure is shown.

[0030] Figure 3 A schematic diagram showing the structure of the software model according to the embodiments of the present disclosure is shown.

[0031] Figure 4 A schematic diagram showing the structure of the conversion module according to the embodiments of the present disclosure is shown.

[0032] Figure 5 A schematic diagram showing the structure of the processing device of the texture coordinates according to the embodiments of the present disclosure is shown.

[0033] Figure 6 A block diagram showing the electronic device 1900 according to the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0034] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the drawings represent functionally identical or similar elements. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless specifically indicated.

[0035] As used herein, the terms “comprise”, “contain”, “have”, or variants thereof are open, and include one or more stated features, integers, elements, steps, components or functions, but do not exclude the presence or addition of one or more other features, integers, elements, steps, components, functions or groups thereof.

[0036] When an element is referred to as being “connected”, “coupled”, “responsive”, or variants thereof, to another element, it can be directly connected, coupled, or responsive to the other element, or there can be intervening elements.

[0037] Although the terms first, second, third, etc. can be used herein to describe various elements / operations, such elements / operations should not be limited by these terms. These terms are only used to distinguish one element / operation from another. Thus, a first element / operation in some embodiments could be termed a second element / operation in other embodiments without departing from the teachings of the present inventive concept.

[0038] The word "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations.

[0039] In addition, for the purpose of convenience and brevity, detailed descriptions of well-known devices, methods, procedures, components, and circuits are omitted so as not to obscure the teachings of the present disclosure. In some instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure the teachings of the present disclosure.

[0040] As described above, in the prior art, an initial precision parameter is usually preset, and the precision parameter is adjusted through multiple iterations. Each iteration includes reconstruction of the software model code, testing using the graphics API test set, adjusting the precision parameter according to the test results, and the like. The graphics API test set includes a large amount of sample data, and each test using the graphics API test set requires a large amount of data processing cost, and multiple iterations further increase the data processing cost. In this case, the processing efficiency of the texture coordinates is also low.

[0041] Further, to achieve bit-level precision, the architecture of the simulated software model needs to be consistent with the architecture of the hardware circuit, so the simulated software model is complex, and the development cost and iteration cost of the software model are greatly increased. Moreover, the complex model design also causes the model to run slowly, further reducing the processing efficiency of the texture coordinates.

[0042] Further, the prior art solution cannot quickly locate the problem of precision, and manual analysis of the test results is required to determine whether the precision meets the requirements, which increases the labor cost.

[0043] Therefore, the present disclosure proposes a texture coordinate processing method and device, electronic equipment, and storage medium. The method can reduce the number of iterations, reduce the data processing cost, and improve the processing efficiency of the texture coordinates.

[0044] Further, the architecture of the software model corresponding to the method does not need to be completely consistent with the hardware circuit, as long as the input and output are consistent with the hardware circuit. In this case, the architecture of the software model is simplified, which can improve the running efficiency of the software model.

[0045] Further, the method can dynamically adjust the precision parameter at runtime to meet the needs of hardware design, architecture definition and software development. The method can also automatically compare the fixed-point number texture coordinates obtained by conversion under different precision parameters with the corresponding reference values at runtime to determine the precision gap between the fixed-point number texture coordinates and the reference values under different precision parameters, and the reference values are the fixed-point number texture coordinates obtained without precision loss, so as to quickly determine whether the precision parameter meets the needs and reduce the labor cost.

[0046] Figure 1 An example application scenario of the texture coordinate processing method according to an embodiment of the present disclosure is shown.

[0047] As shown in Figure 1 , the texture coordinate processing method according to an embodiment of the present disclosure can be executed by a processor. The processor uses a plurality of sets of precision parameters input by a user to execute the texture coordinate processing method according to an embodiment of the present disclosure, converts a texture coordinate in a floating-point number form (a first texture coordinate as described below) to obtain a plurality of texture coordinates in a fixed-point number form (a second texture coordinate as described below), and outputs a texture coordinate in a fixed-point number form with the largest precision loss (a processed texture coordinate as described below) through numerical comparison.

[0048] The output texture coordinate can be displayed to the user, and the user can determine whether the precision of the texture coordinate meets the needs. If the precision of the fixed-point number texture coordinate meets the needs, the precision parameter adjustment is stopped, and suitable precision parameters are further selected from the plurality of sets of precision parameters input this time. If the precision of the fixed-point number texture coordinate does not meet the needs, the user inputs a new plurality of sets of precision parameters, and at least one set of precision parameters in the new plurality of sets of precision parameters is different from the plurality of sets of precision parameters input last time. The processor re-executes the texture coordinate processing method according to an embodiment of the present disclosure.

[0049] Figure 2 A schematic diagram showing the flow of the texture coordinate processing method according to an embodiment of the present disclosure is shown.

[0050] As shown in Figure 2 , in a possible implementation manner, an embodiment of the present disclosure provides a texture coordinate processing method, which comprises:

[0051] Step S21, receiving at least one first texture coordinate and a plurality of sets of precision parameters, the first texture coordinate being a floating-point number;

[0052] Step S22, for each first texture coordinate, converting the first texture coordinate using the plurality of sets of precision parameters to obtain a plurality of second texture coordinates, the second texture coordinates being fixed-point numbers;

[0053] Step S23, for each first texture coordinate conversion obtained a plurality of second texture coordinates, determine the accuracy gap between each second texture coordinate and the reference value corresponding to the second texture coordinate, and determine the second texture coordinate with the largest accuracy gap from the reference value as the processed texture coordinate.

[0054] For example, the processor can perform step S21 to receive at least one first texture coordinate and a plurality of sets of precision parameters. Wherein the texture can include at least one sampling point, and a corresponding first texture coordinate is obtained by sampling at each sampling point. The first texture coordinate can be a normalized floating point number, and the embodiments of the present disclosure do not limit the specific number of bits of the first texture coordinate.

[0055] The plurality of sets of precision parameters can be set and input by a user. In a possible implementation, each set of precision parameters includes an integer number of bits and a decimal number of bits.

[0056] For example, a set of precision parameters can include an integer number of bits M and a decimal number of bits N, which are used to represent the precision parameter as (M, N) hereinafter. M and N are positive integers, and the values of M and N can be set by a user according to application scenario requirements. When the first texture coordinate is a 32-bit floating point number, N is usually less than 23. The embodiments of the present disclosure do not limit the specific values of M and N.

[0057] The integer number of bits and / or the decimal number of bits included in any two sets of precision parameters are different. That is, when the integer number of bits in one set of precision parameters is M1 and the decimal number of bits is N1, and the integer number of bits in another set of precision parameters is M2 and the decimal number of bits is N2, the condition M1=M2 and N1=N2 does not occur.

[0058] The integer number of bits in a set of precision parameters represents the integer number of bits of the fixed point number obtained after the texture coordinate conversion using the set of precision parameters. The decimal number of bits in a set of precision parameters represents the decimal number of bits of the fixed point number obtained after the texture coordinate conversion using the set of precision parameters. Therefore, the values of M and N in each set of precision parameters can be set according to the value of the first texture coordinate and the relationship between the number of bits and the value expression range of the binary number.

[0059] For example, the value expression range of a 3-bit binary number is 0-7, and the value expression range of a 4-bit binary number is 0-15. When the value of the first texture coordinate is 7.5, at least 4-bit binary number is required to represent the integer part of the first texture coordinate, and therefore the value of M can be greater than or equal to 4. It should be understood that too large M is not helpful to improve the accuracy, and therefore an integer value closer to 4 can be selected as M. The value of N is similar to M, and will not be described here.

[0060] The processor can perform step S22, for each first texture coordinate, respectively convert the first texture coordinate using the plurality of sets of precision parameters to obtain a plurality of second texture coordinates, the second texture coordinates being fixed-point numbers. The number of bits of the integer part of the second texture coordinates can be equal to M. The number of bits of the decimal part of the second texture coordinates can be equal to N. In this case, for each first texture coordinate, the precision of the plurality of second texture coordinates obtained by conversion can be different.

[0061] The embodiments of the present disclosure do not limit the specific process of converting the first texture coordinates to the second texture coordinates. In one example, the process of converting the first texture coordinates to the second texture coordinates can include floating-point number to fixed-point number conversion, texture mapping, address and offset calculation, etc. Examples of the process of converting the first texture coordinates to the second texture coordinates are given below.

[0062] After converting the plurality of second texture coordinates for each first texture coordinate using the plurality of sets of precision parameters, step S23 can be performed, for each first texture coordinate, determining the precision gap between each second texture coordinate and the reference value corresponding to the second texture coordinate obtained by conversion. The reference value can be the fixed-point number obtained by converting the first texture coordinate without precision loss. The precision gap between each second texture coordinate and the reference value can represent the precision loss of the second texture coordinate in the conversion process.

[0063] The greater the precision gap between the second texture coordinate and the reference value, the greater the precision loss of the second texture coordinate in the conversion process. The second texture coordinate with the greatest precision gap from the reference value can be determined as the processed texture coordinate. In this case, when the precision of the processed texture coordinate meets the demand, it can be considered that the plurality of sets of precision parameters are all precision parameters that meet the demand, and the user can select appropriate precision parameters from the plurality of sets of precision parameters, without the need for further iterative calculation, thereby reducing the number of iterative calculations. The specific selection method is not described here.

[0064] Further, the processed texture coordinate can also be used in the rendering calculation process of the GPU to ensure that the actual rendering result boundary is controllable.

[0065] According to the texture coordinate processing method of this disclosure, by receiving at least one first texture coordinate and multiple sets of precision parameters, multiple second texture coordinates are obtained by converting each first texture coordinate using the multiple sets of precision parameters. The first texture coordinates are floating-point numbers, and the second texture coordinates are fixed-point numbers; therefore, this method realizes the conversion of texture coordinates from floating-point to fixed-point numbers and achieves multi-precision conversion. For each of the multiple second texture coordinates obtained from the conversion of the first texture coordinate, the precision difference between each second texture coordinate and its corresponding reference value is determined. The second texture coordinate with the largest precision difference from the reference value is determined as the processed texture coordinate. The second texture coordinate with the largest precision difference from the reference value also suffers the greatest precision loss during the conversion process. Therefore, based on whether the precision of the processed texture coordinate meets the precision requirements, it can be determined whether the multiple sets of precision parameters meet the requirements. When the precision of the processed texture coordinate meets the requirements, it can be considered that all multiple sets of precision parameters meet the requirements. The user can then select a suitable precision parameter from the multiple sets of precision parameters without further iterative calculation, thereby reducing the number of iterations, lowering data processing costs, and improving the processing efficiency of texture coordinates.

[0066] This method eliminates the need to refactor the model code and run a large number of test sets, further reducing data processing costs and improving the efficiency of texture coordinate processing.

[0067] In the process of converting each first texture coordinate into multiple second texture coordinates, different second texture coordinates can be converted in parallel, further improving the processing efficiency of texture coordinates.

[0068] This disclosure provides an embodiment of a software model for a processing method that applies texture coordinates. Figure 3 A schematic diagram illustrating the structure of a software model according to an embodiment of the present disclosure is shown.

[0069] like Figure 3 As shown, the software model may include a transformation module and a comparison module. The transformation module receives multiple sets of precision parameters and first texture coordinates ( Figure 3 Taking a first texture coordinate as an example, the module outputs multiple second texture coordinates. The comparison module receives multiple second texture coordinates and selects one of the second texture coordinates as the processed texture coordinate output by calculating the precision difference and comparing the precision difference.

[0070] The modules in the software model work cooperatively to realize efficient conversion of the texture coordinates in the multi-precision requirement scenario and judgment of whether the precision parameter needs to be adjusted. The overall architecture design aims to adapt to different precision requirements of the texture coordinate processing, to ensure that the precision requirements are met in the processing and to speed up the processing of the texture coordinates. The architecture of the software model does not need to be completely consistent with the hardware circuit, as long as the input and output are consistent with the hardware circuit. In this case, the architecture of the software model is simplified, and the running efficiency of the software model can be improved.

[0071] The user can write multiple sets of precision parameters in the form of a queue into a configuration file, and the software model can obtain the current precision parameter queue by reading the configuration file. The configuration file can be adjusted in real time, and the precision parameter queue can be dynamically modified at runtime. This enables the software model to adjust the processing precision of the texture coordinates according to the user's needs. In the case of multiple sampling points, the software model sequentially completes the processing of the first texture coordinates at each sampling point; when the processing of the first texture coordinates at any sampling point is completed, multiple sets of precision parameters can be used according to the storage order of the multiple sets of precision parameters in the queue.

[0072] The software model optimizes the processing of the texture coordinates, can dynamically adjust the processing precision of the texture coordinates, and greatly improves the running efficiency through parallel processing, thereby reducing the test time.

[0073] The comparison module provides a means for the user to quickly locate and optimize the precision problem, and further ensures the accuracy of the rendering result obtained by using the processed coordinates for rendering. Compared with the process of requiring a large amount of manual testing and analysis in the prior art, the adjustment cycle of the precision parameter is greatly shortened, the need for manual intervention is reduced, and the accuracy of the precision test is improved.

[0074] An example of the process of converting the first texture coordinates to the second texture coordinates is described below.

[0075] In a possible implementation, the first texture coordinates include an exponent bit, a mantissa bit, a sign bit,

[0076] The first texture coordinates are converted using multiple sets of precision parameters, including:

[0077] When the first texture coordinates are converted using any one set of precision parameters,

[0078] The mantissa corresponding to the first texture coordinates is determined according to the mantissa bit and the sign bit of the first texture coordinates;

[0079] The reference value corresponding to the set of precision parameters and the first texture coordinates is determined according to the number of bits of the mantissa bit, the exponent bit, and the number of decimal places included in the set of precision parameters;

[0080] The first fixed-point number is obtained by converting the mantissa using the set of precision parameters;

[0081] A second fixed-point number is determined according to the first fixed-point number and the texture mapping parameter;

[0082] A second texture coordinate is determined according to the reference value and the second fixed-point number.

[0083] Figure 4 A schematic diagram showing the structure of a conversion module according to an embodiment of the present disclosure.

[0084] As shown in Figure 4 , the conversion module can include a bit field separation unit, a reference value calculation unit, a precision adjustment unit, a texture mapping unit, an address and offset calculation unit.

[0085] The first texture coordinate can include an exponent bit, a mantissa bit, and a sign bit. Taking the first texture coordinate as a 32-bit floating-point number for example, the first bit is the sign bit, whose value indicates the positive or negative of the floating-point number, usually 0 for positive and 1 for negative. The second to ninth bits are the exponent bits, which are used to indicate the power of the floating-point number. The tenth to thirty-second bits are the mantissa bits, which are used to indicate the precision of the floating-point number.

[0086] The first texture coordinate can be subjected to bit field separation first, so that the exponent bits, the mantissa bits, and the sign bit are separated. This step can be completed by the bit field separation unit. The bit field separation unit also receives the precision parameters (M, N).

[0087] The mantissa corresponding to the first texture coordinate can be determined according to the mantissa bits and the sign bit of the first texture coordinate. When the sign bit is 0, the determined mantissa can be the original code of the mantissa bits. When the sign bit is 1, the determined mantissa can be the complement code of the mantissa bits. This step can be completed by the precision adjustment unit.

[0088] After obtaining the mantissa of the first texture coordinate, the mantissa of the first texture coordinate can be converted using the precision parameters (M, N) to obtain a first fixed-point number. This step can be completed by the precision adjustment unit, and the precision parameters (M, N) can come from the bit field separation unit. The first fixed-point number has an integer part with M bits and a fractional part with N bits. The conversion can be implemented based on existing technologies, and details of the conversion will not be described here.

[0089] In this case, the mantissa of the first texture coordinate can be converted into a first fixed-point number with a specified precision (M, N). Since no exponent alignment is performed, the first fixed-point number can be considered as lossless.

[0090] A second fixed-point number can be determined according to the first fixed-point number and the texture mapping parameter, to ensure that the second fixed-point number can be correctly mapped to the texture data. The integer part of the second fixed-point number can be used as an index value corresponding to the precision parameters (M, N) and the first texture coordinate. This step can be completed by the texture mapping unit.

[0091] In one example, the second fixed-point number can be equal to a product of the first fixed-point number and the texture mapping parameter.

[0092] In one possible implementation,

[0093] When the first texture coordinate is a width coordinate, the texture mapping parameter is a width mapping parameter.

[0094] When the first texture coordinate is a height coordinate, the texture mapping parameter is a height mapping parameter.

[0095] When the first texture coordinate is a depth coordinate, the texture mapping parameter is a depth mapping parameter.

[0096] For example, the texture mapping parameter has multiple types and corresponds to the type of the first texture coordinate. When the first texture coordinate is a width coordinate, the texture mapping parameter can be a width mapping parameter; when the first texture coordinate is a height coordinate, the texture mapping parameter can be a height mapping parameter; and when the first texture coordinate is a depth coordinate, the texture mapping parameter can be a depth mapping parameter.

[0097] The value of the texture mapping parameter is related to the attribute of the sampling point corresponding to the first texture coordinate. The value of the width mapping parameter can be equal to the width of the sampling point, the value of the height mapping parameter can be equal to the height of the sampling point, and the value of the depth mapping parameter can be equal to the depth of the sampling point.

[0098] In this way, the accuracy of the second fixed-point number can be ensured.

[0099] According to the number of significant bits, the exponent bits, and the number of decimal bits of the first texture coordinate, a reference value corresponding to the integer number of bits, the number of decimal bits, and the first texture coordinate is determined. This step can be completed by a reference value calculation unit. In one example, the true value of the reference value can be 1. Those skilled in the art should understand that the true value of the reference value can also be other values, such as 0.5, and the present disclosure does not limit the specific value of the true value of the reference value.

[0100] In the following, an example of determining the reference value is introduced, taking the true value of the reference value as 1.

[0101] In one possible implementation, the reference value corresponding to any set of precision parameters and any first texture coordinate is equal to the maximum value that can be expressed by a Y-bit binary number, Y is equal to the result of subtracting the number of exponent bits of the first texture coordinate from the number of significant bits of the first texture coordinate and adding the number of decimal bits included in the set of precision parameters, and Y is a positive integer.

[0102] For example, one example of determining the reference value is shown in formula (1).

[0103] S = 1 x 2^(W-exp+N) (1)

[0104] Wherein, S represents a reference value corresponding to the precision parameter (M, N) and the first texture coordinate F, W represents the number of the significant bits of the first texture coordinate F, and W can be equal to 23 when the first texture coordinate F is a 32-bit floating point number. exp represents the exponent bits of the first texture coordinate F. N represents the number of the fractional bits in the precision parameter.

[0105] Since the precision corresponding to each group of precision parameters is different, the reference values corresponding to the first texture coordinate F are different. For example, the reference value S1 corresponds to the precision parameter (M=M1, N=N1) and the first texture coordinate F, and the reference value S2 corresponds to the precision parameter (M=M2, N=N2) and the first texture coordinate F. The reference value S2 can be different from the reference value S1.

[0106] In a possible implementation, all the reference values corresponding to the same first texture coordinate have the same true value.

[0107] For example, it can be considered that the reference value, the first fixed point number, the second fixed point number, and the second texture coordinate obtained by using a group of precision parameters and the first texture coordinate F correspond to each other, and all correspond to the group of precision parameters and the first texture coordinate F. Since the influence of the exponent bits on the conversion is removed (W-exp) when the reference value is determined, and the influence of the number of the fractional bits on the conversion is considered (W-exp+N), all the reference values corresponding to the first texture coordinate F have the same true value. The second texture coordinate determined according to each reference value and the corresponding second fixed point number is the second texture coordinate calculated in the case of the exponent alignment, so that the precision loss in the conversion process of the plurality of second texture coordinates obtained by using a plurality of groups of precision parameters and the first texture coordinate F is comparable.

[0108] The calculation of the reference value can be parallel to the calculation of the first fixed point number and the second fixed point number. The advance calculation of the reference value can accelerate the processing process of the texture coordinate, and improve the flexibility of the setting of the precision parameter while realizing the multi-precision conversion of the texture coordinate.

[0109] The second texture coordinate can be determined according to the reference value and the second fixed-point number. This step can be completed by the address and offset calculation unit. In one example, address mode calculation and offset calculation can be performed on the second fixed-point number according to the DirectX 11 (DX11) specification, and the reference value is used as a calculation unit during the calculation process, and the calculation result is the second texture coordinate. For example, in the case where the true value of the reference value is 1, when the true value represented by the second fixed-point number needs to be increased by 1, the second fixed-point number can be directly added to the reference value. The address mode calculation and the offset calculation can be implemented based on the prior art, and the specific calculation process will not be described here. An exemplary calculation process is given below.

[0110] The following describes an exemplary method of determining the accuracy gap between the second texture coordinate and the reference value (the accuracy loss of the second texture coordinate in the conversion process).

[0111] In one possible implementation, the accuracy gap between each second texture coordinate and the reference value corresponding to the second texture coordinate is determined, including:

[0112] The reference value is subjected to a rounding operation, and the integer bits and X decimal bits of the reference value are reserved, X being the number of decimal bits of the second texture coordinate, and X being a positive integer;

[0113] The numerical gap between the second texture coordinate and the reference value is taken as the accuracy gap between the second texture coordinate and the reference value corresponding to the second texture coordinate.

[0114] For example, the reference value is a fixed-point number converted without accuracy loss, and when the first texture coordinate F is a 32-bit floating-point number, the reference value can be regarded as a value of the second texture coordinate obtained by processing the first texture coordinate using integer bits of 41 and decimal bits of 23. Generally, the number of decimal bits of the reference value is greater than the number of decimal bits X of the second texture coordinate. The reference value can be subjected to a rounding operation to reserve the integer bits and X decimal bits of the reference value. During the rounding operation, the rounding algorithm such as Round to Nearest Even (RTE) or the like can be used. Other rounding algorithms or algorithms such as rounding up or rounding down can also be used, and the embodiments of the present disclosure do not limit the specific implementation of the rounding operation.

[0115] After the rounding operation on the reference value, the numerical gap between the second texture coordinate and the reference value can be taken as the accuracy gap between the second texture coordinate and the reference value, that is, the accuracy loss of the second texture coordinate.

[0116] In this way, the credibility of the accuracy loss can be ensured.

[0117] The following takes the first texture coordinate as the floating-point number 0x3E4CCCCD (corresponding to the decimal number 0.2), the integer bit number M as 15, and the decimal bit number N as 8 as an example to introduce an example of obtaining the second texture coordinate and the precision gap.

[0118] Suppose the first texture coordinate is a width coordinate, and the texture mapping parameter is a width mapping parameter and is equal to 100. The address calculation adopts the repeat tiling mode (REPEAT). In this mode, the texture coordinates exceeding the range [0, 1] will be tiled in the texture in a loop.

[0119] Then in the conversion module, the exponent bit exp output by the bit field separation unit can be -3, the mantissa bit can be 0xCCCCCD, and the sign bit can be 0.

[0120] Suppose the number of mantissa bits is 23. The reference value calculated by the reference value calculation unit can be 1*2^(23-(-3)+8)=2^34, which is equivalent to shifting 0x1 left by 34 bits (0x1 << 34) in bit operation, and the result is 0x4 0000 0000.

[0121] The precision adjustment unit converts 0xCC CCCD into the first fixed-point number with the integer bit number 15 and the decimal bit number 8, which is equivalent to shifting the mantissa bit left by 8 bits in bit operation, and the result is 0xCCCC CD00.

[0122] The texture mapping unit calculates the product of the first fixed-point number and the texture mapping parameter to obtain the second fixed-point number, so the second fixed-point number=0xCCCC CD00*100=0x50 0000 1400.

[0123] The address and offset calculation unit determines the upper bound coordinate of the texture according to the reference value and the texture mapping parameter as 0x40000 0000*100=0x19000000000.

[0124] In the repeat tiling mode, the result of the address calculation can be the modulus operation result of the second fixed-point number and the upper bound coordinate of the texture. To eliminate the influence of the exponent bit, the upper bound coordinate of the texture can be right shifted before the modulus operation, and the number of right shift bits can be equal to the exponent bit. That is, the result of the address calculation is 0x50 0000 1400%0xC80 0000 0000=0x50 0000 1400.

[0125] Suppose the texture has no offset, and no filter of the texture coordinate is set, then the second texture coordinate can be obtained by right shifting the result of the address calculation by 23-(-3) bits. At this time, the second texture coordinate is 0x50 0000 1400>>26=0x1400.

[0126] In the comparison module, the reference value can be 0.2x100=20. The integer part of the second texture coordinate 0x1400 is 20, and the decimal part is 0. The precision difference between the second texture coordinate and the reference value is 0.

[0127] Taking the first texture coordinate as a floating-point number 0x3FE6502F (corresponding to a decimal number 1.799322), the integer bit number M as 15, and the decimal bit number N as 16 as an example, an example of obtaining the second texture coordinate and the precision difference is introduced below.

[0128] Suppose the first texture coordinate is a width coordinate, and the texture mapping parameter is a width mapping parameter and is equal to 20. The address calculation adopts a repeat tiling mode (REPEAT). In this mode, the texture coordinates exceeding the range [0, 1] will be tiled in the texture.

[0129] In the conversion module, the exponent bit exp output by the bit field separation unit can be 0, the mantissa bit can be 0x E6502F, and the sign bit can be 0.

[0130] Suppose the number of bits of the mantissa bit is 23. The reference value calculated by the reference value calculation unit can be 1x2^(23-0+16)=2^39, which is equivalent to shifting 0x1 left by 39 bits (0x1 << 39) in bit operation, and the result is 0x80 0000 0000.

[0131] The precision adjustment unit converts 0x E6 502F into a first fixed-point number with an integer bit number of 15 and a decimal bit number of 16, which is equivalent to shifting the mantissa bit left by 16 bits in bit operation, and the result is E6 502F 0000.

[0132] The texture mapping unit calculates the product of the first fixed-point number and the texture mapping parameter to obtain a second fixed-point number, so the second fixed-point number=E6 502F 0000x20=0xA00 0000 0000.

[0133] The address and offset calculation unit determines the coordinate of the upper bound of the texture according to the reference value and the texture mapping parameter as 0x40000 0000x100=0x19000000000.

[0134] In the repeat tiling mode, the result of address calculation can be the modulus operation result of the second fixed-point number and the coordinate of the upper bound of the texture. Since the exponent bit is 0, it is not necessary to shift the coordinate of the upper bound of the texture. That is, the result of address calculation is 0x11FE 43AC 0000%0xA00 0000 0000=0x 7FE 43AC 0000.

[0135] Suppose the texture offset is +2 and the filter of the texture coordinate is not set, the second texture coordinate can be obtained by right shifting the result of the address calculation by 23-(0) bits. At this time, the second texture coordinate is 0x 7FE 43AC 0000 >> (23-0) = 0x F FC87.

[0136] In the comparison module, the reference value can be (1.799322*20) % 20 = 15.98644. The integer part of the second texture coordinate 0x FFC87 is 15, and the decimal part is 0.986. The precision difference between the second texture coordinate and the reference value is 0.

[0137] The embodiments of the present disclosure also propose a texture coordinate processing apparatus, Figure 5 FIG. 1 shows a schematic diagram of the structure of a texture coordinate processing apparatus according to an embodiment of the present disclosure.

[0138] As Figure 5 shown, in a possible implementation, the texture coordinate processing apparatus includes:

[0139] The receiving module 51 is configured to receive at least one first texture coordinate and a plurality of sets of precision parameters, the first texture coordinate being a floating-point number.

[0140] The conversion module 52 is configured to, for each first texture coordinate, convert the first texture coordinate using the plurality of sets of precision parameters respectively, to obtain a plurality of second texture coordinates, the second texture coordinates being fixed-point numbers.

[0141] The determination module 53 is configured to, for each first texture coordinate, determine the precision difference between each second texture coordinate and a reference value corresponding to the second texture coordinate, and determine the second texture coordinate with the largest precision difference with the reference value as the processed texture coordinate.

[0142] The texture coordinate processing apparatus can be the software model described above. The conversion module 52 implements the function of the conversion module of the software model. The determination module 53 implements the function of the comparison module of the software model.

[0143] In a possible implementation, each set of precision parameters includes an integer bit number and a decimal bit number.

[0144] In a possible implementation, the first texture coordinate comprises an exponent bit, a mantissa bit and a sign bit, and the converting the first texture coordinate using the plurality of sets of precision parameters respectively comprises: when converting the first texture coordinate using any one set of precision parameters, determining a mantissa corresponding to the first texture coordinate according to the mantissa bit and the sign bit of the first texture coordinate; determining a reference value corresponding to the set of precision parameters and the first texture coordinate according to the number of bits of the mantissa bit, the exponent bit and the number of decimal digits included in the set of precision parameters; converting the mantissa using the set of precision parameters to obtain a first fixed-point number; determining a second fixed-point number according to the first fixed-point number and a texture mapping parameter; and determining the second texture coordinate according to the reference value and the second fixed-point number.

[0145] In a possible implementation, all reference values corresponding to the same first texture coordinate have the same true value.

[0146] In a possible implementation, when the first texture coordinate is a width coordinate, the texture mapping parameter is a width mapping parameter; when the first texture coordinate is a height coordinate, the texture mapping parameter is a height mapping parameter; and when the first texture coordinate is a depth coordinate, the texture mapping parameter is a depth mapping parameter.

[0147] In a possible implementation, the reference value corresponding to any one set of precision parameters and any one first texture coordinate is equal to the maximum value that can be expressed by a Y-bit binary number, where Y is equal to the number of bits of the mantissa bit of the first texture coordinate minus the exponent bit of the first texture coordinate plus the number of decimal digits included in the set of precision parameters, and Y is a positive integer.

[0148] In a possible implementation, the determining the precision gap between each second texture coordinate and a reference value corresponding to the second texture coordinate comprises: performing a rounding operation on the reference value to retain integer bits and X decimal bits of the reference value, where X is the number of decimal bits of the second texture coordinate, and X is a positive integer; and taking the numerical gap between the second texture coordinate and the reference value as the precision gap between the second texture coordinate and the reference value corresponding to the second texture coordinate.

[0149] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or comprises modules that can be used to execute the methods described in the above method embodiments, and the specific implementation can be referred to the description of the above method embodiments. For briefness, details are not described herein again.

[0150] The embodiments of the present disclosure also provide an electronic device, which comprises a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the above method.

[0151] The embodiment of the present disclosure further provides a nonvolatile computer readable storage medium, which has a computer program stored thereon, and the computer program is executed by a processor to implement the steps of the above method.

[0152] The embodiment of the present disclosure further provides a computer program product, which comprises a computer program or a nonvolatile computer readable storage medium carrying the computer program, and the computer program is executed by a processor to implement the steps of the above method.

[0153] Figure 6 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. For example, the electronic device 1900 can be provided as a server or a terminal device. Referring to Figure 6 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932, for storing instructions executable by the processing component 1922, such as an application program. The application program stored in the memory 1932 can include one or more than one module each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute the instructions to perform the above method.

[0154] The electronic device 1900 can further include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output interface 1958 (I / O interface). The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or the like.

[0155] In an exemplary embodiment, a nonvolatile computer readable storage medium is also provided, such as the memory 1932 comprising computer program instructions executable by the processing component 1922 of the electronic device 1900 to complete the above method.

[0156] Computer readable storage media can be any media that can be read by a machine. Such media can include, but is not limited to, optical discs, flash memory, RAM, ROM, EPROM, EEPROM, and the like. Computer readable storage media can further include any physical medium that is suitable for storing or transferring computer readable instructions in a form a computer program.

[0157] The computer program (or computer readable program instructions) described herein can be downloaded from a computer readable storage medium to individual computing / processing devices, or to external computer or external storage devices, via a network, for example, the Internet, a local area network, a wide area network and / or a wireless network. The network can comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. A network adapter card or network interface in each computing / processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing / processing device.

[0158] Computer readable program instructions for carrying out operations of the present disclosure can be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate array (FPGA), or programmable logic array (PLA) can execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present disclosure.

[0159] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0160] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0161] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0162] The flow diagrams and the block diagrams in the drawings are presented to illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logic functions. In some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and

[0163] Embodiments of the present disclosure have been described above, and the description is intended to be illustrative of the embodiments and not restrictive. Many modifications and variations of the described embodiments are possible and are within the scope of the disclosure. The selection of terms is intended to best describe the principles of the embodiments, practical application, or technical improvements in the art, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method of processing texture coordinates, characterized by, The method comprises: receiving at least one first texture coordinate and a plurality of sets of precision parameters, the first texture coordinate being a floating-point number, each set of precision parameters comprising an integer bit number and a decimal bit number, the integer bit number and the decimal bit number being set according to a value of the first texture coordinate and a relationship between a bit number and a value expression range of a binary number; for each first texture coordinate, converting the first texture coordinate using the plurality of sets of precision parameters respectively to obtain a plurality of second texture coordinates, the second texture coordinates being fixed-point numbers; for the plurality of second texture coordinates converted for each first texture coordinate, determining an accuracy gap between each second texture coordinate and a reference value corresponding to the second texture coordinate, and determining a second texture coordinate with a largest accuracy gap from the reference value as a processed texture coordinate; the first texture coordinate comprises an exponent bit, a mantissa bit and a sign bit, and the converting the first texture coordinate using the plurality of sets of precision parameters respectively comprises: when converting the first texture coordinate using any one set of precision parameters, determining a mantissa corresponding to the first texture coordinate according to the mantissa bit and the sign bit of the first texture coordinate; converting the mantissa using the set of precision parameters to obtain a first fixed-point number; determining a second fixed-point number according to the first fixed-point number and a texture mapping parameter; determining the second texture coordinate according to a reference value corresponding to the set of precision parameters and the first texture coordinate and the second fixed-point number, the reference value being equal to a maximum value expressible by a Y-bit binary number, Y being equal to a result of subtracting the exponent bit of the first texture coordinate from the mantissa bit of the first texture coordinate and adding a decimal bit number included in the set of precision parameters, Y being a positive integer.

2. The method of claim 1, wherein, All reference values corresponding to the same first texture coordinate have the same true value.

3. The method according to claim 1, wherein: when the first texture coordinate is a width coordinate, the texture mapping parameter is a width mapping parameter; when the first texture coordinate is a height coordinate, the texture mapping parameter is a height mapping parameter; when the first texture coordinate is a depth coordinate, the texture mapping parameter is a depth mapping parameter.

4. The method of claim 1, wherein, The determining the accuracy gap between each second texture coordinate and a reference value corresponding to the second texture coordinate comprises: performing a rounding operation on the reference value to retain an integer bit and X decimal bits of the reference value, X being a decimal bit number of the second texture coordinate, X being a positive integer; taking a value difference between the second texture coordinate and the reference value as the accuracy gap between the second texture coordinate and the reference value corresponding to the second texture coordinate.

5. A texture coordinate processing apparatus characterized by comprising: The apparatus comprises: a receiving module configured to receive at least one first texture coordinate and a plurality of sets of precision parameters, the first texture coordinate being a floating-point number, each set of precision parameters comprising an integer bit number and a decimal bit number, the integer bit number and the decimal bit number being set according to a value of the first texture coordinate and a relationship between a bit number and a value expression range of a binary number; The conversion module is configured to convert each first texture coordinate using the multiple sets of precision parameters respectively to obtain multiple second texture coordinates, wherein each second texture coordinate is a fixed-point number. The determination module is configured to determine, for each second texture coordinate obtained by converting each first texture coordinate, an accuracy gap between the second texture coordinate and a reference value corresponding to the second texture coordinate, and determine a second texture coordinate with the largest accuracy gap from the reference value as the processed texture coordinate. The first texture coordinate includes an exponent bit, a mantissa bit, and a sign bit, and the conversion of the first texture coordinate using the multiple sets of precision parameters includes: When converting the first texture coordinate using any one set of precision parameters, determining a mantissa corresponding to the first texture coordinate according to the mantissa bit and the sign bit of the first texture coordinate; converting the mantissa using the set of precision parameters to obtain a first fixed-point number; determining a second fixed-point number according to the first fixed-point number and a texture mapping parameter; determining the second texture coordinate according to a reference value corresponding to the set of precision parameters and the first texture coordinate and the second fixed-point number, wherein the reference value is equal to the largest number that can be expressed by a Y-bit binary number, Y is equal to the number of bits of the mantissa bit of the first texture coordinate minus the exponent bit of the first texture coordinate plus the number of decimal places included in the set of precision parameters, and Y is a positive integer.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1-5. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 4.

7. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Texture address rewinding method and device and storage medium

    CN119494864A