WO2006017410A2 - Filtering unit for floating-point texture data - Google Patents

Filtering unit for floating-point texture data Download PDF

Info

Publication number
WO2006017410A2
WO2006017410A2 PCT/US2005/027162 US2005027162W WO2006017410A2 WO 2006017410 A2 WO2006017410 A2 WO 2006017410A2 US 2005027162 W US2005027162 W US 2005027162W WO 2006017410 A2 WO2006017410 A2 WO 2006017410A2
Authority
WO
WIPO (PCT)
Prior art keywords
point
fixed
circuit
floating
texture
Prior art date
Application number
PCT/US2005/027162
Other languages
French (fr)
Other versions
WO2006017410A3 (en
Inventor
Walter E. Donovan
Anders M. Kugler
Christopher D. S. Donham
Original Assignee
Nvidia Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nvidia Corporation filed Critical Nvidia Corporation
Publication of WO2006017410A2 publication Critical patent/WO2006017410A2/en
Publication of WO2006017410A3 publication Critical patent/WO2006017410A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/28Indexing scheme for image data processing or generation, in general involving image processing hardware

Definitions

  • the present invention relates in general to graphics processing devices with texture filtering, and in particular to a filtering unit for floating-point texture data.
  • Texture blending is a common technique for achieving various effects in computer generated images, such as realistic modeling of rough surfaces (e.g., brick or stone walls), fabric patterns, etc.
  • Texture blending generally involves defining a texture map, most often as an array of "texels.” Each texel has unique coordinates (e.g., in two or three dimensions), a color, and in some instances other attributes such as a surface normal.
  • texture coordinates e.g., in two or three dimensions
  • To apply the texture to the surface of an object e.g., a wall or an article of clothing
  • fixed points on the object surface are assigned texture coordinates.
  • the texture coordinates are used to fetch one or more texels from the texture map, and the color and/or other attributes of the fetched texel(s) are used in shading the fragment.
  • Typical texture maps are defined such that the portion of the object surface contained within a given fragment covers portions of several texels. For example, the same texture is mapped at multiple levels of detail (LODs) so that, regardless of what fraction of the object surface is contained within a fragment, the number of texels to which the fragment maps can be controlled by selecting a texture map with an appropriate LOD.
  • LODs levels of detail
  • Fig. 1 illustrates a conventional texture map 100 in a 2D space defined by texture coordinates (s, t).
  • Texture map 100 includes texels 101, 102, 103, 104, which have respective values a, b, c, d for some attribute (e.g., color).
  • a fragment 1 10 (dashed box) is mapped onto texture map 100 (e.g., by assigning texture coordinates to each corner of pixel 110) in such a way that it covers a portion of each of texels 101, 102, 103, 104.
  • texture filters are also in common use. For instance, trilinear filtering is frequently used in conjunction with texture maps that represent the same texture at different levels of detail (LODs). The two nearest LODs for a given fragment are selected (usually based on distance from the eyepoint to the object surface being rendered), and a bilinear filter is applied at each of these two LODs to obtain two filtered values Fl and F2 in accordance with Eq. 1. The final result F is a weighted average of Fl and F2, where respective weights/? and ⁇ -p are assigned to the two LODs (e.g., based on the distance from the eyepoint to the object surface).
  • LODs levels of detail
  • Anisotropic texture filters are also known, in which different numbers of texels are considered in different directions in a 2D or 3D texture space. Like trilinear filters, anisotropic filters can often be implemented as weighted averages of results of multiple bilinear filtering operations.
  • a typical texture filtering unit includes a bilinear interpolation ("Bilerp") circuit and an accumulator circuit.
  • the Bilerp circuit receives four texture values ⁇ a, b, c, d) and two weights (w s , W 1 ) and applies a bilinear filter (e.g., Eq. 1).
  • the accumulator circuit computes a weighted sum of the results of different passes through the Bilerp circuit using per-pass weights w/, where different texture values (a, b, c, d) and weights (w s , w h wj) can be supplied for each pass.
  • trilinear filtering can be implemented by instructing the accumulator circuit to accumulate results of two passes through the Bilerp circuit (with per-pass weights /? and 1-p).
  • Anisotropic filtering can involve accumulating larger numbers (e.g., up to 24) of passes with appropriate per- pass weights.
  • texture filtering circuits are conventionally implemented using fixed-point arithmetic circuits.
  • Fixed-point texture data limits the degree of detail (e.g., subtle color variations) that can be captured in a texture map; in principle, greater realism can be achieved by using floating-point texture data.
  • conventional texture filtering units require modification. lW v «u
  • Embodiments of the present invention provide floating-point texture filtering units for graphics processors that leverage existing fixed-point filter circuits.
  • Groups of floating-point texture values to be filtered are converted to products of a fixed-point mantissa and a scaling factor (e.g., block exponent) that is the same for each texture value.
  • the fixed-point mantissas are filtered using a fixed-point filter circuit, and the filtered mantissa is combined with the scaling factor to determine a floating-point filtered value.
  • Multiple floating-point filter results may be combined (e.g., in a weighted average) in an accumulator circuit.
  • the same fixed-point filter circuit and accumulator circuit may also be used to filter fixed-point texture data via a fixed-point input path that bypasses the initial format conversion.
  • a device for filtering floating ⁇ point texture data in a graphics processor includes a prescaling circuit, a fixed-point filtering circuit, and an accumulator circuit.
  • the prescaling circuit is configured to convert each one of a group of floating-point input texture values to a product of a fixed-point mantissa and a scaling factor, where the scaling factor is the same for each one of the group of floating-point input texture values.
  • the fixed-point filtering circuit is configured to compute a fixed-point filter output value from a plurality of fixed-point filter input values, and the fixed-point filtering circuit is coupled to receive, as the fixed-point filter input values, the fixed-point mantissas for the group of floating-point input texture values.
  • the accumulator circuit is coupled to receive the scaling factor from the prescaling circuit and the filter output value from the fixed-point filtering circuit and is configured to scale the filter output value by a reciprocal of the scaling factor, thereby generating a floating ⁇ point filter result.
  • the accumulator circuit may also be configured to accumulate a weighted sum of a number of floating-point filter results, each of which may be obtained by processing a group of texture values through the prescaling circuit and the fixed-point filtering circuit.
  • the device also includes a fixed-point input path.
  • the fixed-point input path is configured to provide a group of fixed-point input texture values as the filter inputs to the fixed-point filtering circuit, and the fixed-point input path being coupled to the fixed-point filtering circuit via a fixed-point input path that bypasses the prescaling circuit.
  • the device is configurable for operation using either fixed-point texture values or floating-point texture values as inputs.
  • the accumulator circuit may be configured to be operable in either of a fixed-point mode and a floating-point mode; for instance, in the fixed point mode, the accumulator may operate with the scaling factor equal to 1.
  • a graphics processor has a shader module for computing a fragment color.
  • the shader module includes a texture fetch unit and a texture filter unit.
  • the texture fetch unit is configured to fetch a number of texture values corresponding to a fragment and to determine whether the fetched texture values are in a fixed-point format or a floating-point format.
  • the texture filter unit is coupled to receive the fetched texture values from the texture fetch unit and is configured to apply a filter to the fetched texture values, thereby generating a filter result.
  • the texture filter unit is operable in either of a fixed-point mode and a floating-point mode, and it operates in the fixed-point mode in the event that the fetched texture values are in the fixed-point format and in the floating-point mode in the event that the fetched texture vales are in the floating-point format.
  • a method for filtering texture data in a graphics processor is provided.
  • a group of floating-point texture values is received.
  • a scaling factor is determined for the group of received texture values.
  • Each of the received texture values is scaled by the scaling factor, and each of the scaled texture values is converted to a fixed-point format.
  • the converted texture values are provided as filter inputs to a fixed-point texture filtering circuit configured to compute a fixed-point filter output from a plurality of filtered inputs, and a filter output in a fixed-point format is received from the texture filtering circuit.
  • the filter output value is scaled by a reciprocal of the scaling factor, thereby generating a floating-point filter result.
  • a weighted sum of a plurality of floating-point filter results, each obtained by the same steps, may be accumulated.
  • a group of fixed-point texture values may also be received and provided as filter inputs to the fixed-point texture filtering circuit.
  • a filter output in a fixed-point format is then received from the texture filtering circuit.
  • a weighted sum of fixed-point filter outputs, each obtained by these steps may also be accumulated.
  • Fig. 1 illustrates a conventional texture map in a 2D texture coordinate space
  • FIG. 2 is a simplified block diagram of a computer system according to an embodiment of the present invention.
  • FIG. 3 is a simplified block diagram of a rendering pipeline according to an embodiment of the present invention.
  • Fig. 4 is a simplified block diagram of a texture filtering unit according to an embodiment of the present invention.
  • FIG. 5 is a block diagram of an implementation of a preprocessing block according to an embodiment of the present invention.
  • FIG. 6 is a simplified block diagram of a floating-point accumulator circuit according to an embodiment of the present invention.
  • Fig. 7 is a block diagram of an output circuit according to an embodiment of the present invention.
  • Embodiments of the present invention provide floating-point texture filtering units for graphics processors that leverage existing fixed-point filter circuits.
  • Groups of floating-point texture values to be filtered are converted to products of a fixed-point mantissa and a scaling factor (e.g., block exponent) that is the same for each texture value.
  • the fixed-point mantissas are filtered using a fixed-point filter circuit, and the filtered mantissa is combined with the scaling factor to determine a floating-point filtered value.
  • Multiple floating-point filter results may be combined (e.g., in a weighted average) in a floating-point accumulator circuit.
  • the same fixed-point filter circuit may also be used to filter fixed-point texture data via a fixed-point input path that bypasses the format conversion and a fixed-point accumulator.
  • FIG. 2 is a simplified block diagram of a computer system 200 according to an embodiment of the present invention.
  • Computer system 200 includes a central processing unit (CPU) 202 and a system memory 204 communicating via a bus 206.
  • User input is received from one or more user input devices 208 (e.g., keyboard, mouse) coupled to bus 206.
  • Visual output is provided on a pixel-based display device 210 (e.g., a conventional CRT or LCD based monitor) operating under control of a graphics processing subsystem 212 coupled to system bus 206.
  • a pixel-based display device 210 e.g., a conventional CRT or LCD based monitor
  • a system disk 228 and other components may also be coupled to system bus 206.
  • System bus 206 may be implemented using one or more of various bus protocols including PCI (Peripheral Component Interconnect), AGP (Advanced Graphics Processing) and/or PCI Express (PCI-E); appropriate "bridge” chips such as a north bridge and south bridge (not shown) may be provided to interconnect various components and/or buses.
  • PCI Peripheral Component Interconnect
  • AGP Advanced Graphics Processing
  • PCI-E PCI Express
  • Graphics processing subsystem 212 includes a graphics processing unit (GPU) 214 and a graphics memory 216, which may be implemented, e.g., using one or more integrated circuit devices such as programmable processors, application specific integrated circuits (ASICs), and memory devices.
  • GPU 214 includes a rendering pipeline 220, a memory interface module 222, and a scanout module 224.
  • Rendering pipeline 220 may be configured to perform various tasks related to generating pixel data from graphics data supplied via system bus 206 (e.g., implementing various 2D and/or 3D rendering algorithms), interacting with graphics memory 216 to store and update pixel data, and the like.
  • Rendering pipeline 220 is advantageously configured to generate pixel data from 2D or 3D scene data provided by various programs executing on CPU 202.
  • rendering pipeline 220 is described further below.
  • Memory interface module 222 which communicates with rendering pipeline 220 and scanout control logic 224, manages all interactions with graphics memory 216.
  • Memory interface module 222 may also include pathways for writing pixel data received from system bus 206 to graphics memory 216 without processing by rendering pipeline 220.
  • the particular configuration of memory interface module 222 may be varied as desired, and a detailed description is omitted as not being critical to understanding the present invention.
  • Graphics memory 216 which may be implemented using one or more integrated circuit memory devices of generally conventional design, may contain various physical or logical subdivisions, such as a pixel buffer 226.
  • Pixel buffer 226 stores pixel data for an image (or for a part of an image) that is read and processed by scanout module 224 and transmitted to display device 210 for display. This pixel data may be generated, e.g., from 2D or 3D scene data provided to rendering pipeline 220 of GPU 214 via system bus 206, or it may be generated by various processes executing on CPU 202 and provided to pixel buffer 226 via system bus 206.
  • pixel buffer 226 can be double buffered so that while data for a first image is being read for display from a "front" buffer, data for a second image can be written to a "back" buffer without affecting the currently displayed image.
  • Other portions of graphics memory 216 may be used to store data required by GPU 214 (such as texture data, color lookup tables, etc.), executable program code for GPU 214 and so on.
  • (0028 J Scanout module 224 which may be integrated in a single chip with GPU 214 or implemented in a separate chip, reads pixel color data from pixel buffer 226 and transfers the data to display device 210 to be displayed.
  • scanout module 224 operates isochronously, scanning out frames of pixel data at a prescribed screen refresh rate (e.g., 80 Hz) regardless of any other activity that may be occurring in GPU 214 or elsewhere in system 200.
  • the screen refresh rate can be a user selectable parameter, and the scanout order may be varied as appropriate to the display format (e.g., interlaced or progressive scan).
  • Scanout module 224 may also perform other operations, such as adjusting color values for particular display hardware and/or generating composite screen images by combining the pixel data from pixel buffer 226 with data for a video or cursor overlay image or the like, which may be obtained, e.g., from graphics memory 216, system memory 204, or another data source (not shown).
  • scanout module 224 may also rescale images (e.g., enlarging or reducing), e.g., by interpolating pixel data from pixel buffer 226.
  • CPU 202 executes various programs that are (temporarily) resident in system memory 204.
  • these programs include one or more operating system (OS) programs 232, one or more application programs 234, and one or more driver programs 236 for graphics processing subsystem 212.
  • OS operating system
  • application programs 234 application programs 2344
  • driver programs 236 for graphics processing subsystem 212.
  • OS operating system
  • driver programs 236 for graphics processing subsystem 212.
  • Operating system programs 232 and/or application programs 234 may be of conventional design.
  • An application program 234 may be, for instance, a video game program that generates graphics data and invokes appropriate rendering functions of GPU 214 (e.g., rendering pipeline 220) to transform the graphics data to pixel data.
  • Another application program 234 may generate pixel data and provide the pixel data to graphics processing subsystem 212 for display. It is to be understood that any number of application programs that generate pixel and/or graphics data may be executing concurrently on CPU 202.
  • Operating system programs 232 e.g., the Graphical Device Interface (GDI) component of the Microsoft Windows operating system
  • GDI Graphical Device Interface
  • Driver program 236 enables communication with graphics processing subsystem 212, including both rendering pipeline 220 and scanout module 224.
  • Driver program 236 advantageously implements one or more standard application program interfaces (APIs), such as Open GL, Microsoft DirectX, or D3D, for communication with graphics processing subsystem 212; any number or combination of APIs may be supported, and in some embodiments separate driver programs 236 are provided to implement different APIs.
  • APIs application program interfaces
  • operating system programs 232 and/or application programs 234 are able to instruct driver program 236 to transfer geometry data or pixel data to graphics processing subsystem 212 via system bus 206, to control operations of rendering pipeline 220, to modify state parameters for scanout module 224 and so on.
  • driver program 236 may vary depending on the implementation of GPU 214, and driver program 236 may also transmit commands and/or data implementing additional functionality (e.g., special visual effects) not controlled by operating system programs 232 or application programs 234.
  • additional functionality e.g., special visual effects
  • Various techniques for managing communication between driver program 236 and graphics processing subsystem 212 are known in the art and may be used, including asynchronous techniques.
  • a GPU may be implemented using any suitable technologies, e.g., as one or more integrated circuit devices.
  • the GPU may be mounted on an expansion card that may include one or more such processors, mounted directly on a system motherboard, or integrated into a system chipset component (e.g., into the north bridge chip of one commonly used PC system architecture).
  • the graphics processing subsystem may include any amount of dedicated graphics memory (some implementations may have no dedicated graphics memory) and may use system memory and dedicated graphics memory in any combination.
  • the pixel buffer may be implemented in dedicated graphics memory or system memory as desired.
  • the scanout circuitry may be integrated with a GPU or provided on a separate chip and may be implemented, e.g., using one or more ASICs, programmable processor elements, other integrated circuit technologies, or any combination thereof.
  • the GPU may be incorporated into a variety of devices, including general purpose computer systems, video game consoles and other special purpose computer systems, DVD players, and the like.
  • Fig. 3 is a simplified block diagram of a rendering pipeline 220 according to an embodiment of the present invention.
  • rendering pipeline 220 includes a geometry module 302, a setup module 304, a rasterizer 306, a shader 308, and a raster operations module 310.
  • Geometry module 302 which may be of generally conventional design, receives data describing a 3D scene to be rendered.
  • the scene data includes data defining a number of objects (e.g., a table, a chair, a person or animal) that may be present in the scene.
  • Each object is advantageously represented as a primitive (e.g., a triangle, a line) or a group of primitives for which vertex locations are specified in an object coordinate system.
  • each vertex also has various attributes associated with it.
  • attributes of a vertex may include any property that is specified on a per-vertex basis.
  • attributes include red, green, and blue color components; a transparency parameter; and texture coordinates relating the vertex location to a texture map.
  • each object may have its own coordinate system, additional data or commands are advantageously provided to position the objects relative to each other, e.g., by specifying a transformation matrix for each object from object coordinates to a common "world" coordinate system.
  • the transformation matrix for an object is applied to each of its vertices.
  • World coordinates may be further transformed to viewing coordinates with an origin at an eyepoint and a z (depth) axis defined by a view direction, and viewing coordinates may be further transformed to a screen space where the (x, y) coordinates correspond to a pixel (or fragment) array.
  • Geometry module 302 may also perform other functions such as culling invisible geometry, clipping geometry that is partly invisible, and the like. Numerous examples of vertex operations are known in the art and may be implemented in geometry module 302.
  • Geometry module 302 provides the transformed primitives to setup module 304. For each primitive it receives, setup module 304 computes edge equations for use by rasterizer 306 and provides vertices for use in computing attribute values for any fragments covered by the primitive.
  • Rasterizer 306 performs scan conversion on the received primitives (e.g., using the edge equations). Scan conversion generally involves defining an array of fragments (e.g., pixels) corresponding to screen locations, determining which primitive(s) is (are) visible for each fragment, and providing the ordered vertex list for that primitive to shader 308 for use in determining the color of the fragment. Rasterizer 306 may implement conventional scan conversion algorithms for determining visibility and may be configurable to allow an application programmer to select among different algorithms. It is to be understood that the fragments defined for rasterizer 306 need not correspond to a pixel array of a particular display device. For example, in order to support various antialiasing algorithms known in the art, it may be desirable for rasterizer 306 to sample the image at a higher resolution than is supported by a given display device.
  • Scan conversion generally involves defining an array of fragments (e.g., pixels) corresponding to screen locations, determining which primitive(s) is (are) visible for each fragment, and providing the
  • Shader 308 uses vertex information for each fragment provided by rasterizer 306 to determine a color (and, in some embodiments, other attributes such as depth) for the fragment. Various techniques for determining color (or other attributes) can be used, examples of which are known in the art.
  • shader 308 is implemented as a programmable shader that receives a program (some sequence of operations) to be used for processing fragments and executes the program for each fragment.
  • the shader program may include instructions for a variety of fragment processing operations, including texture blending. Texture blending programs generally include instructions for selecting a texture to apply to a fragment, selecting among various texture filtering algorithms (e.g., bilinear, trilinear, or anisotropic filtering), and computing filtering weights.
  • various texture filtering algorithms e.g., bilinear, trilinear, or anisotropic filtering
  • Shader 308 advantageously includes a texture fetch unit 312 and a texture filter unit 314 for executing texture blending instructions.
  • Texture fetch unit 312 which may be of generally conventional design, is advantageously configured to fetch either fixed-point or floating-point texture data for a fragment.
  • a texture map may be stored in local or remote memory in fixed-point or floating-point format.
  • texture fetch unit 312 determines the texture coordinates for a fragment and fetches one or more corresponding texels from the in-memory texture map. Texture fetch unit 312 may also assign weights to each texel using conventional techniques.
  • Texture fetch unit 312 advantageously also determines whether the texture map is stored in fixed-point or floating-point format.
  • a format flag (or other suitable data structure) is stored in memory in association with the texture map, and texture fetch unit 312 may read the format flag together with the texels.
  • different areas of memory may be reserved for floating-point and fixed-point texture maps, and texture fetch unit 312 may determine the numerical format for a given texture map based on a memory address for the texel or map. Other techniques for distinguishing floating-point and fixed-point texture maps may also be implemented.
  • texture filtering unit 314 applies a suitable filter to the retrieved texels.
  • texture filtering unit 314 receives texture values and weights from texture fetch unit 312 and includes arithmetic circuitry for performing a filtering operation on the received values.
  • Texture filtering unit 314 is advantageously configured to operate on both floating-point and fixed- point textures, and texture fetch unit 312 advantageously provides the format flag (or another format indicator) to texture filtering unit 314. After filtering, texture filtering unit 314 returns a result to shader 308 for further processing, e.g., blending with an underlying fragment color or surface normal.
  • shader 308 may also apply other effects, including various lighting and/or fog effects known in the art, to compute a final fragment color, and shader 308 may include components (not shown) related to such computations.
  • shader 308 produces a color value (e.g., in RGB ⁇ format) for each fragment. These color values may be stored, e.g., in graphics memory 216 or elsewhere.
  • Raster operations module 310 performs various operations on the array of fragment color values generated by shader 308. For example, where rasterizer 306 generates an oversampled fragment array, raster operations module 310 may downfilter the fragment data to match the pixel resolution of a display device. The final pixel color values generated by raster operations module 310 are stored in pixel buffer 226 for subsequent scanout by scanout module 224.
  • rendering pipeline described herein is illustrative and that variations and modifications are possible.
  • the division of rendering functions among various functional blocks described herein is made for purposes of description, and it is to be understood that different divisions (e.g., division into more or fewer functional blocks) might be made and that different components of the pipeline may share some circuitry.
  • the rendering pipeline is advantageously implemented such that different components can operate concurrently on different data.
  • each module within the rendering pipeline may also operate in pipelined fashion.
  • a rendering pipeline may include multiple instances of any or all of the modules described herein (e.g., multiple shader modules that operate on different fragments in parallel), thereby boosting overall rendering speed. Additionally, multiple instances of the entire rendering pipeline might be implemented in a single graphics processor.
  • a texture filtering unit according to an embodiment of the present invention will now be described.
  • Fixed-point formats are identified herein by the notation (sM.N) or (uM.N), where "s” indicates a signed format, "u” indicates an unsigned format, M is the number of bits before the decimal point, and N is the number of bits after the decimal point.
  • sM.N Fixed-point formats
  • uM.N floating-point formats
  • M indicates a signed format
  • u indicates an unsigned format
  • M is the number of bits before the decimal point
  • N is the number of bits after the decimal point.
  • (s2.14) uses a total of 16 bits to encode numbers in the range (-4, 4).
  • the texture filtering unit uses an internal unsigned format with a positive bias; for example (u2.14) can be used to represent the same range as (s2.14) if numbers are biased upward by adding 4.0 (represented as a bit field 0x8000) to the 16-bit field; such biasing is known in the art.
  • Floating-point formats used herein include a mantissa having some number of bits (which may include a sign bit) and an exponent having some number of bits (generally fewer bits than the mantissa, although this is not required).
  • the value V of a floating-point number is its mantissa (m) multiplied by 2 raised to the power of the exponent (x); i.e., V- /71*2 * .
  • the mantissa may be expressed in any convenient fixed-point format and is not constrained to being in any particular format or range.
  • a block floating-point format used herein has a mantissa in (s2.14) or (s2.22) format and a 5-bit exponent.
  • fpl ⁇ is a 16-bit floating-point format based on IEEE 754 encoding standards.
  • a number is represented by a sign bit, five exponent bits, and ten mantissa bits. The five exponent bits are biased by +15, and the ten mantissa bits represent the fractional portion of the mantissa, with an implicit "1" preceding the decimal point.
  • Certain values are reserved to indicate special numbers including underflows ("Denorms"), zero, positive and negative infinity (INF), and undefined (“not a number," or NaN) values. It is to be understood that other formats may be substituted for any of the specific formats used as examples herein.
  • Fig. 4 is a simplified block diagram of a texture filtering unit 400 according to an embodiment of the present invention.
  • Texture filtering unit 400 provides a floating-point wrapper around a conventional fixed-point bilinear interpolation circuit and is configurable for filtering either fixed-point or floating-point texture data.
  • Texture filtering unit 400 includes a floating-point preprocessing block 402, an input selection circuit 404, a fixed-point bilinear interpolation (Bilerp) circuit 406, an accumulator circuit 408 that performs both fixed-point and floating-point accumulation, a fixed-point (s2.14) formatting circuit 410, a floating-point (fpl ⁇ ) format conversion circuit 412, and an output selection circuit 414.
  • Bitp bilinear interpolation
  • Texture filtering unit 400 advantageously communicates with other components (not shown) that supply input data including texture values (a, b, c, d) for a fragment and weights (w s , w t , wj) to be used during filtering.
  • the input data advantageously also include a format signal (FMT) indicating whether the texture values are in a fixed-point or floating-point format.
  • texture filtering unit 400 implements texture filter unit 314 of shader 308 (Fig. 3) and receives input data from texture fetch unit 312 and/or other control circuitry (not shown) in shader 308. Examples of suitable control circuits are known in the art, and a detailed description is omitted as not being critical to understanding the present invention.
  • Fixed-point texture filtering is provided by fixed-point Bilerp circuit 406, which may be of generally conventional design, and accumulator circuit 408, which advantageously handles both fixed point and floating point formats as described below.
  • fixed-point Bilerp circuit 406 receives as inputs four fixed-point texture values (a, b, c, d) and two weights (w s , w t ). These inputs are used to implement a conventional bilinear filter (e.g., Eq. 1) that produces a filtered value ⁇ /.
  • More complex filters such as trilinear filters or anisotropic filters, can be implemented by passing multiple groups of texture values and associated weights to Bilerp circuit 406 and accumulating a weighted average of the results ⁇ / from each pass in accumulator circuit 408.
  • any number of bilinear filtering passes may be accumulated with weights ny determined in accordance with the particular filtering algorithm.
  • the number of passes to be accumulated and a weight vty- for each pass may be provided as input parameters to accumulator circuit 408 (e.g., by control circuits of shader 308 as mentioned above); when the specified number of passes has been reached, accumulator circuit 408 provides its output X A to fixed-point formatting circuit 410.
  • Bilerp circuit 406 and accumulator circuit 408 may support any desired fixed- point format, such as (s2.14).
  • Bilerp circuit 406 receives (s2.14) texture values, biases each value upward by 32K (effectively converting the values to an unsigned representation), applies the bilinear filter, and biases the result downward by 4.0 to determine ⁇ /.
  • the weights w s , w t , and vv/ may be in a different format, e.g., (ul.9) for weights in the range [0, I].
  • accumulator circuit 408 advantageously preserves a larger number of bits than Bilerp circuit 406 in order to reduce or eliminate rounding errors that can occur when filter results are multiplied by weights less than 1.
  • fixed-point filter circuit 406 may use (s2.14) format while accumulator circuit 408 uses (s2.22).
  • Fixed-point formatting circuit 410 is provided to convert the internal format of accumulator circuit 408 to the final fixed-point fo ⁇ nat in the event that different formats are used; for instance, conversion from (s2.22) to (s2.14) can be performed by simply dropping LSBs or by rounding.
  • Floating-point texture filtering is provided by fixed-point Bilerp circuit 406 in cooperation with preprocessing block 402, accumulator circuit 408, and floating-point format conversion circuit 412.
  • This embodiment exploits the linearity of the filtering algorithm to implement floating-point filtering using fixed-point arithmetic circuits.
  • a linear filter F(a, b, c, d) such as the bilinear filter of Eq. 1, has the property that for any nonzero scalar q:
  • Preprocessing block 402 of texture filter 400 prescales the input floating-point texture values (a, b, c, d) by a factor q — 2 ⁇ k , where the block exponent k is selected based on respective exponent fields of the floating-point values (a, b, c, d). With an appropriate selection of block exponent k, the prescaled floating-point values:
  • a' a*T*
  • b' b*T*
  • c' c*2- k
  • the prescaled texture values (a', b', c', d') are provided (in the fixed-point format) to fixed-point Bilerp circuit 406, which generates a filtered mantissa value:
  • Bilerp circuit 406 implements a linear filter.
  • accumulator circuit 408 receives the prescale factor (block exponent k) in addition to the filtered mantissa value ⁇ / and obtains the desired floating-point result:
  • accumulator circuit 408 is advantageously configurable to accumulate Bilerp results ⁇ / and block exponents k over multiple passes, with each result being weighted by a respective weight w/, any filtering algorithm that can be performed for fixed-point texture data can also be performed for floating-point texture data.
  • accumulator circuit 408 provides the accumulated results (a mantissa ⁇ A and a block exponent k A ) to format conversion circuit 412.
  • Fo ⁇ nat conversion circuit 412 converts the floating-point number represented by mantissa ⁇ A and block exponent k A to a standard floating-point fo ⁇ nat (e.g., fpl6).
  • Texture filtering unit 400 is advantageously configurable so that fixed-point or floating-point filtering can be dynamically selected.
  • input selection circuit 404 and output selection circuit 414 are provided.
  • Selection circuits 404, 414 are controlled by a fo ⁇ nat selection (FMT) signal that indicates whether the input texture data is in fixed-point format or floating-point format.
  • FMT fo ⁇ nat selection
  • texture data values (a, b, c, d) are provided to texture filtering unit 400 in either fixed-point or floating-point format. These texture data values may correspond to any attribute of a texture for which filtering is desired, including color (or individual color components), surface normal, or any other attribute.
  • the format signal FMT which may be generated, e.g., by a texture fetch unit as described above, is also provided in an appropriate state to indicate whether the texture data is in fixed-point or floating-point format.
  • input selection circuit 404 For fixed-point data, input selection circuit 404 provides the fixed- point values ⁇ a, b, c, d) directly to Bilerp circuit 406, ignoring the output of preprocessing block 402, and output selection circuit 414 selects the output of the fixed-point data path (provided by fixed-point formatting circuit 410) as the final output AQ, ignoring the output of the floating-point data path (provided by format conversion circuit 412).
  • input selection circuit 404 selects the prescaled outputs (a 1 , b', d , d') as fixed- point inputs to Bilerp circuit 406, and output selection circuit 414 selects the output of the floating-point data path as the final output XQ, ignoring the output of the fixed-point data path.
  • format signal FMT may also be used to disable components of filter 400 that are not active at a given time.
  • fixed-point formatting circuit 410 may be disabled when the input data is floating-point; for fixed- point data, preprocessing block 402 and floating-point format conversion circuit 412 may be disabled.
  • the block exponent k provided by preprocessing block 402 may be set to zero or another convenient value.
  • FIG. 5 is a block diagram of an implementation of preprocessing block 402 according to an embodiment of the present invention.
  • Preprocessing block 402 converts floating-point texture values ⁇ a, b, c, d) in fpl ⁇ format to fixed-point values (a', b', d , d') in (s2.14) format by prescaling the inputs using a block exponent k.
  • Preprocessing block 402 includes a special number circuit 504 and a prescaling block 506.
  • Special number circuit 504 receives the floating-point texture values (a, b, c, d) and the associated weights (w s , W 1 ); detects any special numbers (e.g., INF, NaN); and where appropriate, generates a special number output ⁇ s on signal path 522 and a bypass signal on signal path 524 that are used in subsequent circuits to cause the special number output ⁇ s to override the result of Bilerp circuit 406. As described below, these signals facilitate emulation of the special-number arithmetic of a floating-point texture filter.
  • special numbers e.g., INF, NaN
  • any NaN or INF texture value that is to be multiplied by a zero weight is replaced with a zero and processed in the normal manner.
  • the special number output ⁇ s is set to positive (negative) INF and the bypass signal is asserted.
  • the texture values are passed through unaltered and the bypass signal is deasserted; ⁇ s may be set to any convenient value (e.g., zero).
  • these special number rules result in correct modeling of a floating-point bilinear filter. It will be appreciated that conventional logic circuitry for detecting special numbers may be used to implement these rules and that different rules for handling special numbers might also be implemented.
  • Prescaling block 506 which determines the block exponent k, includes an exponent extraction circuit 508, a four-way comparison circuit 510, an exponent subtraction (ESUB) circuit 512, and an (s2.14) format conversion circuit 514.
  • Exponent extraction circuit 508 extracts the exponent bits from each of inputs (a, b, c, d) and provides the exponents (denoted by a.e, b.e, c.e, d.e) to four- way comparison circuit 510.
  • Four-way comparison circuit 510 selects the largest of the four exponents as block exponent k.
  • four- way comparison circuit 510 may perform two-way comparisons between pairs of inputs (a.e, b.e) and (c.e, d.e) to select the larger of each pair, then perform a two-way comparison on the results of the first two comparisons; any conventional comparison circuitry may be used.
  • ESUB circuit 512 To prescale the inputs (a, b, c, d) by ESUB circuit 512 subtracts the value k from the exponent portion of each input, resulting in prescaled inputs (a 1 , b', c', d').
  • ESUB circuit 512 is advantageously configured to handle any exponent underflows correctly (e.g., by right-shifting mantissa bits or flushing inputs to zero as appropriate). Where the largest of the four exponents is chosen as block exponent k, the largest prescaled input (a 1 , b' , c' , d') has an absolute value in the range [1, 2), while the other prescaled inputs have absolute values in the range [0, 2).
  • Format conversion circuit 514 converts the prescaled fpl6 values to a fixed-point (s2.l4) representation. Since the prescaled values have absolute values less than 2, the fixed-point representation does not overflow; any underflows are flushed to zero. Conventional format conversion circuits and techniques may be used to implement format conversion circuit 514, and circuit 514 may convert the numbers to any format that is appropriate for inputs to Bilerp circuit 406.
  • the prescaling factor (exponent k) is provided to accumulator circuit 408.
  • selection circuit 516 which may be, e.g., a conventional multiplexer controlled by the format selection signal FMT, can be used to set block exponent k to zero, thereby establishing a scaling factor of 1 for all fixed-point inputs.
  • preprocessing circuit described herein is illustrative and that variations and modifications are possible. For example, rather than selecting the largest exponent as the block exponent for prescaling, a different number might be chosen. For a given embodiment, an optimal choice of block exponent may depend in part on the particular fixed-point format used by Bilerp circuit 406. [0068] Referring again to Fig. 4, for floating-point texture inputs, the prescaled texture values (a 1 , b', c', d') from preprocessing circuit 402 are provided to fixed-point Bilerp circuit 406 by input selection circuit 404 as described above.
  • Bilerp circuit 406 applies a bilinear filter and provides the (fixed-point) result Xf to accumulator circuit 408. It should be noted that the operation of Bilerp circuit 406 is advantageously independent of whether the inputs were received via the fixed-point or floating-point input path; thus conventional fixed-point Bilerp circuits may be used without modification.
  • Fig. 6 is a simplified block diagram of accumulator circuit 408 according to an embodiment of the present invention.
  • accumulator circuit 408 is provided with weights uy for computing a weighted sum of results of multiple passes through Bilerp circuit 406.
  • accumulator circuit 408 reintroduces the block exponent k associated with each pass. (Because prescale block 506 described above advantageously selects the block exponent k independently for each pass, k will generally be different for different passes.)
  • accumulator circuit 408 advantageously implements rules for handling cases where the floating-point input texture data includes a special number (e.g., NaN or INF) in a manner that emulates the behavior of a floating-point bilinear filter circuit. For instance, in an fpl6 floating-point filter, it would be expected that if one of the input texture values is NaN (or INF), the result should also be NaN (or INF). Such behavior can be implemented by using the special value ⁇ s (lines 522) and the bypass signal (line 524) provided by special number circuit 504 (Fig. 5) to override the results of Bilerp circuit 406.
  • ⁇ s lines 522
  • bypass signal line 524
  • accumulator circuit 408 includes a register 602 for storing an accumulated mantissa value ⁇ A and a register 604 for storing an accumulated block exponent k A .
  • Accumulated mantissa ⁇ A is advantageously stored in a fixed-point (s2.22) format, and block exponent k A is stored as an integer (e.g., an unsigned 5 bit integer with a +15 bias to cover the full range of possible fpl6 exponents).
  • Registers 602 and 604 are updated as results of each filter pass are received and are read out to output stage 412 when accumulation is complete.
  • Accumulator circuit 408 receives as inputs the current filter result ⁇ f, a weighting factor vv/to be applied to the current result, and the current block exponent k.
  • Multiplier 606 multiplies ⁇ f by w/, providing the result as a current mantissa ⁇ j ⁇ .
  • a floating-point addition module 608 interprets the current mantissa ⁇ / w and block exponent A: as a block floating-point result ⁇ f w * 2 k and adds this result to an accumulated block floating-point result ⁇ A * 2 104 .
  • floating-point addition module 608 determines which of current block exponent k and accumulated block exponent k A is larger, shifts one of the mantissas ⁇ A and ⁇ / w so that both floating-point values are represented using the larger block exponent, then adds the mantissas, storing the sum as ⁇ ⁇ in register 602 and the larger block exponent as k A in register 604.
  • floating-point addition module 608 includes a maximizer circuit 610 that selects the larger of k and k A as a new accumulated block exponent (k A o).
  • a subtraction circuit 612 subtracts k from k A o, and a bit-shift circuit 614 right-shifts current mantissa ⁇ f w by (k A o - k) bits.
  • a subtraction circuit 616 subtracts k A from k A o, and a bit-shift circuit 618 right-shifts accumulated mantissa ⁇ A by (k A0 - k A ) bits.
  • Bit-shift circuits 614 and 616 advantageously provide their outputs in (s2.22) format to avoid loss of numerical precision.
  • Fixed-point addition circuit 620 adds the shifted mantissa values provided by bit- shift circuits 614 and 618 to produce a new accumulated mantissa ⁇ A o in (s2.22) format.
  • an overflow in fixed-point addition circuit 620 may result in k A o being incremented by 1 and ⁇ A o being right-shifted by 1.
  • k A o can be selected so that such an overflow does not occur.
  • weights Wf implement a weighted average with the sum of all weights equal to 1.0 (as is usually the case for filtering) and all texture input values are finite (which is the case when the bypass signal is not asserted), the floating-point filter result remains finite.
  • addition module 608 it is not necessary for addition module 608 to detect overflow situations in which the sum of two finite floating-point numbers results in a special number (e.g., NaN or INF) as is often done in general-purpose floating-point addition circuits.
  • bypass signal When the bypass signal is not asserted, the new accumulated mantissa ⁇ A o and the new accumulated block exponent k A o are selected by selection circuit 624 and written to registers 602 and 604, respectively.
  • the bypass signal When the bypass signal is asserted, the normal-case results ⁇ A o and k A o are overridden by a special value, as will now be described.
  • the special value ⁇ s provided by special number circuit 504 (Fig. 5) on lines 522 is received at a format circuit 622, which reformats the fpl6 value into a block exponent k S o and a mantissa ⁇ so in (s2.22) format.
  • kso may be zero, and ⁇ so may include all bits of the fp 16 representation of ⁇ s, with the remaining bits set to zero.
  • selection circuit 624 selects the special-number results ( ⁇ so, kso), and these results are written to registers 602 and 604, respectively.
  • Special flag register 626 can be used by various circuits to determine whether the value in register 602 is a normal mantissa or a special value, so that correct behavior for special numbers can be implemented.
  • addition circuit 620 may be configured to read special flag register 626 and to implement appropriate arithmetic rules for special numbers, e.g., that NaN added to any number results in NaN, etc.
  • addition circuit 620 can be configured to simply pass through the special value ⁇ A in the event that the special number flag in register 626 is set.
  • registers 602 and 604 can be read out to format conversion stage 412 (Fig. 4) in response to control signals (not shown), which may be generated using conventional techniques. Additional control signals (not shown) may be provided for resetting the stored values in registers 602 and 604 (e.g., to zero) and special flag register 626 to initialize accumulator circuit 408.
  • special numbers are not defined in the fixed-point format, and the bypass signal would not be asserted during fixed-point accumulation; in other embodiments, special fixed-point numbers might be defined and detected.
  • the accumulation circuit may include a general-purpose floating-point addition circuit, with each received ( ⁇ / w , k) pair being converted to a suitable floating-point format prior to addition. Handling of special numbers may also be varied. For instance, the special- number bypass signal may be used to disable various elements of the accumulator circuit when the special value ⁇ s is to be selected, or different rules for handling special numbers might be implemented. In other embodiments, separate fixed-point and floating-point accumulator circuits may be implemented.
  • Fig. 7 is a block diagram of a floating-point format conversion circuit 412 according to an embodiment of the present invention.
  • format conversion circuit 412 receives the final output values ⁇ A and k A from registers 602 and 604 of accumulation circuit 408 (Fig. 6) and the special flag value from special flag register 626.
  • Normal conversion circuit 704 and special conversion circuit 706 generate "normal" and special interpretations of the final output values ⁇ A and k A , respectively, in a desired output format (e.g., fpl6). The correct interpretation is selected by a selection circuit 708 based on the special flag value.
  • normal conversion circuit 704 generates an fpl6 value corresponding to ⁇ A * 2 1 ⁇ .
  • Special conversion circuit 706 converts ⁇ A to fpl6 format (e.g., by dropping any extra bits that were added by format circuit 622 described above).
  • Selection circuit 708 selects between the normal value provided by normal conversion circuit 704 and the special value provided by special conversion circuit 706 based on whether the special flag (from register 626) is asserted. This selection is provided to output selection circuit 414 (Fig. 4) as the floating-point filtered texture value ⁇ o.
  • Other format conversion circuits may also be implemented for consistency with the internal and external floating-point formats in a particular embodiment.
  • the accumulator circuit maintains the accumulated result in the desired output format, and a separate format conversion stage may be omitted.
  • texture filtering unit 400 leverages a fixed-point Bilerp circuit to filter floating-point texture data and, for any floating-point inputs, can produce the same filtered result that would have been obtained using a floating-point Bilerp circuit.
  • a floating-point Bilerp circuit can be emulated for special number inputs as well as normal inputs.
  • underflows e.g., fpl ⁇ Denorms
  • use of a fixed-point Bilerp circuit for filtering floating-point data need not result in loss of numerical precision.
  • the fixed-point and floating-point formats described herein can include any number of bits; in particular, additional bits may be used internally in order to reduce or eliminate rounding errors and truncated at the output stage.
  • the texture filtering unit described herein is capable of handling fixed-point or floating-point texture data at the same rate. (The rate depends on implementation details such as the input texel bandwidth; for instance, in one embodiment, a rate of two Bilerp operations per clock is supported.) To match this performance, a design with a floating-point filter circuit would need to include a separate, parallel fixed-point filter path, which would further increase chip area.
  • any fixed-point filter circuit that implements a linear filtering algorithm can be used in place of the Bilerp circuit described herein.
  • the fixed-point filter circuit may be configured to filter any number of input values and may also be used to implement filters involving fewer input values, e.g., by setting values for any unused inputs to zero.
  • the accumulator circuit may be configured to accumulate filter results received from multiple fixed-point filter circuits that operate in parallel instead of or in addition to accumulating multiple results from one fixed-point filter circuit.
  • the texture values provided to the texture filter unit may include any texel attribute including but not limited to colors or color components, surface normals (or components thereof), and the like.
  • the texture filtering unit may be configured to filter multiple attributes in parallel.
  • Fixed-point and floating-point numbers may be expressed in any desired format, not limited to the particular examples described herein.
  • the texture filter unit, or any component thereof may use an internal representation for fixed-point and/or floating-point numbers that is identical to or different from the external representation.
  • multiple alternative floating-point (or fixed-point) formats may be supported, and appropriate format signals and/or reformatting units may be included to control and/or perform appropriate format conversions.
  • circuits described herein can be implemented using conventional techniques and may include, e.g., ASICs, programmable circuits configured with suitable program code, and other devices; electronic, optical, and/or mechanical circuit technologies may be used as desired. It is to be understood that while the present description makes reference to various functional blocks, these blocks are used solely for purposes of description and are not intended to limit the invention to particular physical configurations; circuitry implementing various operations may be shared or replicated among blocks as desired.
  • Graphics processors incorporating the texture filtering unit described herein may be adapted to a variety of computer systems, including general-purpose computer systems (desktops, laptops, etc.) and special-purpose computer systems (video game consoles, personal digital assistants, cell phones, etc.).
  • general-purpose computer systems desktops, laptops, etc.
  • special-purpose computer systems video game consoles, personal digital assistants, cell phones, etc.

Abstract

Floating-point texture filtering units leverage existing fixed-point filter circuits. Groups of floating-point texture values are converted to products of a fixed-point mantissa and a scaling factor that is the same for each texture value in the group. The fixed-point mantissas are filtered using a fixed-point filter circuit, and the filtered mantissa is combined with the scaling factor to determine a floating-point filtered value. Multiple floating-point filter results may be combined in a floating-point accumulator circuit. The same fixed-point filter circuit may also be used to filter fixed-point texture data by providing fixed-point input path that bypasses the format conversion and a fixed-point accumulator.

Description

FILTERING UNIT FOR FLOATING-POINT TEXTURE DATA
BACKGROUND OF THE INVENTION
[00011 The present invention relates in general to graphics processing devices with texture filtering, and in particular to a filtering unit for floating-point texture data.
[0002| Texture blending is a common technique for achieving various effects in computer generated images, such as realistic modeling of rough surfaces (e.g., brick or stone walls), fabric patterns, etc. Texture blending generally involves defining a texture map, most often as an array of "texels." Each texel has unique coordinates (e.g., in two or three dimensions), a color, and in some instances other attributes such as a surface normal. To apply the texture to the surface of an object (e.g., a wall or an article of clothing), fixed points on the object surface are assigned texture coordinates. After determining that a given fragment (or pixel) of the rendered image contains a particular point on the object surface, the texture coordinates are used to fetch one or more texels from the texture map, and the color and/or other attributes of the fetched texel(s) are used in shading the fragment.
[0003] Typical texture maps are defined such that the portion of the object surface contained within a given fragment covers portions of several texels. For example, the same texture is mapped at multiple levels of detail (LODs) so that, regardless of what fraction of the object surface is contained within a fragment, the number of texels to which the fragment maps can be controlled by selecting a texture map with an appropriate LOD.
[0004] Where multiple texels are covered by a fragment, the respective attributes of these texels are combined (filtered) to determine the texture attributes applicable to the fragment. For instance, Fig. 1 illustrates a conventional texture map 100 in a 2D space defined by texture coordinates (s, t). Texture map 100 includes texels 101, 102, 103, 104, which have respective values a, b, c, d for some attribute (e.g., color). A fragment 1 10 (dashed box) is mapped onto texture map 100 (e.g., by assigning texture coordinates to each corner of pixel 110) in such a way that it covers a portion of each of texels 101, 102, 103, 104. The texture attribute F for pixel 110 can be computed using the well known bilinear filtering formula: F(a, b, c, d) = wt*[w *a + (l-ws)*b] + (l-w,)*K*c + (l-ws)*d], (Eq. 1) where ws and w, are weight parameters (in the range [0, I]) that can be determined from distances in the st plane as shown in Fig. 1.
[0005] Other types of texture filters are also in common use. For instance, trilinear filtering is frequently used in conjunction with texture maps that represent the same texture at different levels of detail (LODs). The two nearest LODs for a given fragment are selected (usually based on distance from the eyepoint to the object surface being rendered), and a bilinear filter is applied at each of these two LODs to obtain two filtered values Fl and F2 in accordance with Eq. 1. The final result F is a weighted average of Fl and F2, where respective weights/? and \-p are assigned to the two LODs (e.g., based on the distance from the eyepoint to the object surface). Anisotropic texture filters are also known, in which different numbers of texels are considered in different directions in a 2D or 3D texture space. Like trilinear filters, anisotropic filters can often be implemented as weighted averages of results of multiple bilinear filtering operations.
[0006] Such filters can be computationally intensive, and graphics processors often include specialized texture filtering units that can quickly compute a filtered texture value from a set of input texture values and weights. A typical texture filtering unit includes a bilinear interpolation ("Bilerp") circuit and an accumulator circuit. The Bilerp circuit receives four texture values {a, b, c, d) and two weights (ws, W1) and applies a bilinear filter (e.g., Eq. 1). The accumulator circuit computes a weighted sum of the results of different passes through the Bilerp circuit using per-pass weights w/, where different texture values (a, b, c, d) and weights (ws, wh wj) can be supplied for each pass. Thus, trilinear filtering can be implemented by instructing the accumulator circuit to accumulate results of two passes through the Bilerp circuit (with per-pass weights /? and 1-p). Anisotropic filtering can involve accumulating larger numbers (e.g., up to 24) of passes with appropriate per- pass weights.
[0007] To reduce chip area and cost, texture filtering circuits are conventionally implemented using fixed-point arithmetic circuits. Fixed-point texture data, however, limits the degree of detail (e.g., subtle color variations) that can be captured in a texture map; in principle, greater realism can be achieved by using floating-point texture data. To support floating-point data, conventional texture filtering units require modification. lWv«u| me uxeu-poini arnnmetic circuits of a conventional texture filtering unit (e.g., in the Bilerp and accumulator circuits) with standard floating-point arithmetic circuits significantly increases chip area and cost. In addition, existing graphics application programs generally use fixed-point texture data, so fast filtering of fixed-point texture data also needs to be supported. Supporting fixed-point texture data would require either converting the texture data to floating-point format and converting the filter result back to fixed-point format (which would slow the processing of fixed-point texture data) or providing a separate fixed-point filtering circuit (which would further increase chip area and complexity).
[0009| It would therefore be desirable to provide an efficient texture filtering unit that is ca apr able of processing both floating-point and fixed-point texture data.
BRIEF SUMMARY OF THE INVENTION
[0010) Embodiments of the present invention provide floating-point texture filtering units for graphics processors that leverage existing fixed-point filter circuits. Groups of floating-point texture values to be filtered are converted to products of a fixed-point mantissa and a scaling factor (e.g., block exponent) that is the same for each texture value. The fixed-point mantissas are filtered using a fixed-point filter circuit, and the filtered mantissa is combined with the scaling factor to determine a floating-point filtered value. Multiple floating-point filter results may be combined (e.g., in a weighted average) in an accumulator circuit. The same fixed-point filter circuit and accumulator circuit may also be used to filter fixed-point texture data via a fixed-point input path that bypasses the initial format conversion.
[001 IJ According to one aspect of the present invention, a device for filtering floating¬ point texture data in a graphics processor includes a prescaling circuit, a fixed-point filtering circuit, and an accumulator circuit. The prescaling circuit is configured to convert each one of a group of floating-point input texture values to a product of a fixed-point mantissa and a scaling factor, where the scaling factor is the same for each one of the group of floating-point input texture values. The fixed-point filtering circuit is configured to compute a fixed-point filter output value from a plurality of fixed-point filter input values, and the fixed-point filtering circuit is coupled to receive, as the fixed-point filter input values, the fixed-point mantissas for the group of floating-point input texture values. The accumulator circuit is coupled to receive the scaling factor from the prescaling circuit and the filter output value from the fixed-point filtering circuit and is configured to scale the filter output value by a reciprocal of the scaling factor, thereby generating a floating¬ point filter result. In some embodiments, the accumulator circuit may also be configured to accumulate a weighted sum of a number of floating-point filter results, each of which may be obtained by processing a group of texture values through the prescaling circuit and the fixed-point filtering circuit.
[0012] In some embodiments, the device also includes a fixed-point input path. The fixed-point input path is configured to provide a group of fixed-point input texture values as the filter inputs to the fixed-point filtering circuit, and the fixed-point input path being coupled to the fixed-point filtering circuit via a fixed-point input path that bypasses the prescaling circuit. In this embodiment, the device is configurable for operation using either fixed-point texture values or floating-point texture values as inputs. The accumulator circuit may be configured to be operable in either of a fixed-point mode and a floating-point mode; for instance, in the fixed point mode, the accumulator may operate with the scaling factor equal to 1.
[0013 J According to another aspect of the present invention, a graphics processor has a shader module for computing a fragment color. The shader module includes a texture fetch unit and a texture filter unit. The texture fetch unit is configured to fetch a number of texture values corresponding to a fragment and to determine whether the fetched texture values are in a fixed-point format or a floating-point format. The texture filter unit is coupled to receive the fetched texture values from the texture fetch unit and is configured to apply a filter to the fetched texture values, thereby generating a filter result. The texture filter unit is operable in either of a fixed-point mode and a floating-point mode, and it operates in the fixed-point mode in the event that the fetched texture values are in the fixed-point format and in the floating-point mode in the event that the fetched texture vales are in the floating-point format.
[0014] According to still another aspect of the present invention, a method for filtering texture data in a graphics processor is provided. A group of floating-point texture values is received. A scaling factor is determined for the group of received texture values. Each of the received texture values is scaled by the scaling factor, and each of the scaled texture values is converted to a fixed-point format. The converted texture values are provided as filter inputs to a fixed-point texture filtering circuit configured to compute a fixed-point filter output from a plurality of filtered inputs, and a filter output in a fixed-point format is received from the texture filtering circuit. The filter output value is scaled by a reciprocal of the scaling factor, thereby generating a floating-point filter result. In some embodiments, a weighted sum of a plurality of floating-point filter results, each obtained by the same steps, may be accumulated. In other embodiments, a group of fixed-point texture values may also be received and provided as filter inputs to the fixed-point texture filtering circuit. A filter output in a fixed-point format is then received from the texture filtering circuit. A weighted sum of fixed-point filter outputs, each obtained by these steps may also be accumulated.
[0015] The following detailed description together with the accompanying drawings will provide a better understanding of the nature and advantages of the present invention.
BRIEF DESCRIPTION OF THE DRAWINGS [0016] Fig. 1 illustrates a conventional texture map in a 2D texture coordinate space;
[0017] Fig. 2 is a simplified block diagram of a computer system according to an embodiment of the present invention;
[0018] Fig. 3 is a simplified block diagram of a rendering pipeline according to an embodiment of the present invention;
[0019] Fig. 4 is a simplified block diagram of a texture filtering unit according to an embodiment of the present invention;
[0020] Fig. 5 is a block diagram of an implementation of a preprocessing block according to an embodiment of the present invention;
[0021] Fig. 6 is a simplified block diagram of a floating-point accumulator circuit according to an embodiment of the present invention; and
[0022] Fig. 7 is a block diagram of an output circuit according to an embodiment of the present invention.
DETAILED DESCRIPTION OF THE INVENTION
[0023] Embodiments of the present invention provide floating-point texture filtering units for graphics processors that leverage existing fixed-point filter circuits. Groups of floating-point texture values to be filtered are converted to products of a fixed-point mantissa and a scaling factor (e.g., block exponent) that is the same for each texture value. The fixed-point mantissas are filtered using a fixed-point filter circuit, and the filtered mantissa is combined with the scaling factor to determine a floating-point filtered value. Multiple floating-point filter results may be combined (e.g., in a weighted average) in a floating-point accumulator circuit. The same fixed-point filter circuit may also be used to filter fixed-point texture data via a fixed-point input path that bypasses the format conversion and a fixed-point accumulator.
[0024) Graphics processors incorporating embodiments of the present invention can be included in a variety of computer systems. Fig. 2 is a simplified block diagram of a computer system 200 according to an embodiment of the present invention. Computer system 200 includes a central processing unit (CPU) 202 and a system memory 204 communicating via a bus 206. User input is received from one or more user input devices 208 (e.g., keyboard, mouse) coupled to bus 206. Visual output is provided on a pixel-based display device 210 (e.g., a conventional CRT or LCD based monitor) operating under control of a graphics processing subsystem 212 coupled to system bus 206. A system disk 228 and other components, such as one or more removable storage devices 229 (e.g., floppy disk drive, compact disk (CD) drive, and/or DVD drive), may also be coupled to system bus 206. System bus 206 may be implemented using one or more of various bus protocols including PCI (Peripheral Component Interconnect), AGP (Advanced Graphics Processing) and/or PCI Express (PCI-E); appropriate "bridge" chips such as a north bridge and south bridge (not shown) may be provided to interconnect various components and/or buses.
[0025] Graphics processing subsystem 212 includes a graphics processing unit (GPU) 214 and a graphics memory 216, which may be implemented, e.g., using one or more integrated circuit devices such as programmable processors, application specific integrated circuits (ASICs), and memory devices. GPU 214 includes a rendering pipeline 220, a memory interface module 222, and a scanout module 224. Rendering pipeline 220 may be configured to perform various tasks related to generating pixel data from graphics data supplied via system bus 206 (e.g., implementing various 2D and/or 3D rendering algorithms), interacting with graphics memory 216 to store and update pixel data, and the like. Rendering pipeline 220 is advantageously configured to generate pixel data from 2D or 3D scene data provided by various programs executing on CPU 202. One embodiment of rendering pipeline 220 is described further below. [0026] Memory interface module 222, which communicates with rendering pipeline 220 and scanout control logic 224, manages all interactions with graphics memory 216. Memory interface module 222 may also include pathways for writing pixel data received from system bus 206 to graphics memory 216 without processing by rendering pipeline 220. The particular configuration of memory interface module 222 may be varied as desired, and a detailed description is omitted as not being critical to understanding the present invention.
[0027] Graphics memory 216, which may be implemented using one or more integrated circuit memory devices of generally conventional design, may contain various physical or logical subdivisions, such as a pixel buffer 226. Pixel buffer 226 stores pixel data for an image (or for a part of an image) that is read and processed by scanout module 224 and transmitted to display device 210 for display. This pixel data may be generated, e.g., from 2D or 3D scene data provided to rendering pipeline 220 of GPU 214 via system bus 206, or it may be generated by various processes executing on CPU 202 and provided to pixel buffer 226 via system bus 206. In some embodiments, pixel buffer 226 can be double buffered so that while data for a first image is being read for display from a "front" buffer, data for a second image can be written to a "back" buffer without affecting the currently displayed image. Other portions of graphics memory 216 may be used to store data required by GPU 214 (such as texture data, color lookup tables, etc.), executable program code for GPU 214 and so on.
(0028 J Scanout module 224, which may be integrated in a single chip with GPU 214 or implemented in a separate chip, reads pixel color data from pixel buffer 226 and transfers the data to display device 210 to be displayed. In one embodiment, scanout module 224 operates isochronously, scanning out frames of pixel data at a prescribed screen refresh rate (e.g., 80 Hz) regardless of any other activity that may be occurring in GPU 214 or elsewhere in system 200. In some embodiments, the screen refresh rate can be a user selectable parameter, and the scanout order may be varied as appropriate to the display format (e.g., interlaced or progressive scan). Scanout module 224 may also perform other operations, such as adjusting color values for particular display hardware and/or generating composite screen images by combining the pixel data from pixel buffer 226 with data for a video or cursor overlay image or the like, which may be obtained, e.g., from graphics memory 216, system memory 204, or another data source (not shown). In some embodiments, scanout module 224 may also rescale images (e.g., enlarging or reducing), e.g., by interpolating pixel data from pixel buffer 226.
[0029] During operation of system 200, CPU 202 executes various programs that are (temporarily) resident in system memory 204. In one embodiment, these programs include one or more operating system (OS) programs 232, one or more application programs 234, and one or more driver programs 236 for graphics processing subsystem 212. It is to be understood that, although these programs are shown as residing in system memory 204, the invention is not limited to any particular mechanism for supplying program instructions for execution by CPU 202. For instance, at any given time some or all of the program instructions for any of these programs may be present within CPU 202 (e.g., in an on chip instruction cache and/or various buffers and registers), in a page file or memory mapped file on system disk 228, and/or in other storage space.
[0030] Operating system programs 232 and/or application programs 234 may be of conventional design. An application program 234 may be, for instance, a video game program that generates graphics data and invokes appropriate rendering functions of GPU 214 (e.g., rendering pipeline 220) to transform the graphics data to pixel data. Another application program 234 may generate pixel data and provide the pixel data to graphics processing subsystem 212 for display. It is to be understood that any number of application programs that generate pixel and/or graphics data may be executing concurrently on CPU 202. Operating system programs 232 (e.g., the Graphical Device Interface (GDI) component of the Microsoft Windows operating system) may also generate pixel and/or graphics data to be processed by graphics processing subsystem 212.
[0031] Driver program 236 enables communication with graphics processing subsystem 212, including both rendering pipeline 220 and scanout module 224. Driver program 236 advantageously implements one or more standard application program interfaces (APIs), such as Open GL, Microsoft DirectX, or D3D, for communication with graphics processing subsystem 212; any number or combination of APIs may be supported, and in some embodiments separate driver programs 236 are provided to implement different APIs. By invoking appropriate API function calls, operating system programs 232 and/or application programs 234 are able to instruct driver program 236 to transfer geometry data or pixel data to graphics processing subsystem 212 via system bus 206, to control operations of rendering pipeline 220, to modify state parameters for scanout module 224 and so on. The specific commands and/or data transmitted to graphics processing subsystem 212 by driver program 236 in response to an API function call may vary depending on the implementation of GPU 214, and driver program 236 may also transmit commands and/or data implementing additional functionality (e.g., special visual effects) not controlled by operating system programs 232 or application programs 234. Various techniques for managing communication between driver program 236 and graphics processing subsystem 212 are known in the art and may be used, including asynchronous techniques.
[0032J It will be appreciated that the system described herein is illustrative and that variations and modifications are possible. A GPU may be implemented using any suitable technologies, e.g., as one or more integrated circuit devices. The GPU may be mounted on an expansion card that may include one or more such processors, mounted directly on a system motherboard, or integrated into a system chipset component (e.g., into the north bridge chip of one commonly used PC system architecture). The graphics processing subsystem may include any amount of dedicated graphics memory (some implementations may have no dedicated graphics memory) and may use system memory and dedicated graphics memory in any combination. In particular, the pixel buffer may be implemented in dedicated graphics memory or system memory as desired. The scanout circuitry may be integrated with a GPU or provided on a separate chip and may be implemented, e.g., using one or more ASICs, programmable processor elements, other integrated circuit technologies, or any combination thereof. In addition, the GPU may be incorporated into a variety of devices, including general purpose computer systems, video game consoles and other special purpose computer systems, DVD players, and the like.
[0033] Fig. 3 is a simplified block diagram of a rendering pipeline 220 according to an embodiment of the present invention. In this embodiment, rendering pipeline 220 includes a geometry module 302, a setup module 304, a rasterizer 306, a shader 308, and a raster operations module 310. Geometry module 302, which may be of generally conventional design, receives data describing a 3D scene to be rendered. In one embodiment, the scene data includes data defining a number of objects (e.g., a table, a chair, a person or animal) that may be present in the scene. Each object is advantageously represented as a primitive (e.g., a triangle, a line) or a group of primitives for which vertex locations are specified in an object coordinate system. In addition to a location, each vertex also has various attributes associated with it. In general, attributes of a vertex may include any property that is specified on a per-vertex basis. In one embodiment, attributes include red, green, and blue color components; a transparency parameter; and texture coordinates relating the vertex location to a texture map.
[0034] Since each object may have its own coordinate system, additional data or commands are advantageously provided to position the objects relative to each other, e.g., by specifying a transformation matrix for each object from object coordinates to a common "world" coordinate system. The transformation matrix for an object is applied to each of its vertices. World coordinates may be further transformed to viewing coordinates with an origin at an eyepoint and a z (depth) axis defined by a view direction, and viewing coordinates may be further transformed to a screen space where the (x, y) coordinates correspond to a pixel (or fragment) array. Geometry module 302 may also perform other functions such as culling invisible geometry, clipping geometry that is partly invisible, and the like. Numerous examples of vertex operations are known in the art and may be implemented in geometry module 302.
[0035] Geometry module 302 provides the transformed primitives to setup module 304. For each primitive it receives, setup module 304 computes edge equations for use by rasterizer 306 and provides vertices for use in computing attribute values for any fragments covered by the primitive.
[0036] Rasterizer 306 performs scan conversion on the received primitives (e.g., using the edge equations). Scan conversion generally involves defining an array of fragments (e.g., pixels) corresponding to screen locations, determining which primitive(s) is (are) visible for each fragment, and providing the ordered vertex list for that primitive to shader 308 for use in determining the color of the fragment. Rasterizer 306 may implement conventional scan conversion algorithms for determining visibility and may be configurable to allow an application programmer to select among different algorithms. It is to be understood that the fragments defined for rasterizer 306 need not correspond to a pixel array of a particular display device. For example, in order to support various antialiasing algorithms known in the art, it may be desirable for rasterizer 306 to sample the image at a higher resolution than is supported by a given display device.
[0037] Shader 308 uses vertex information for each fragment provided by rasterizer 306 to determine a color (and, in some embodiments, other attributes such as depth) for the fragment. Various techniques for determining color (or other attributes) can be used, examples of which are known in the art. In some embodiments, shader 308 is implemented as a programmable shader that receives a program (some sequence of operations) to be used for processing fragments and executes the program for each fragment. The shader program may include instructions for a variety of fragment processing operations, including texture blending. Texture blending programs generally include instructions for selecting a texture to apply to a fragment, selecting among various texture filtering algorithms (e.g., bilinear, trilinear, or anisotropic filtering), and computing filtering weights.
[0038] Shader 308 advantageously includes a texture fetch unit 312 and a texture filter unit 314 for executing texture blending instructions. Texture fetch unit 312, which may be of generally conventional design, is advantageously configured to fetch either fixed-point or floating-point texture data for a fragment. A texture map may be stored in local or remote memory in fixed-point or floating-point format. During fragment processing by shader 308, texture fetch unit 312 determines the texture coordinates for a fragment and fetches one or more corresponding texels from the in-memory texture map. Texture fetch unit 312 may also assign weights to each texel using conventional techniques.
[0039] Texture fetch unit 312 advantageously also determines whether the texture map is stored in fixed-point or floating-point format. In one embodiment, a format flag (or other suitable data structure) is stored in memory in association with the texture map, and texture fetch unit 312 may read the format flag together with the texels. Alternatively, different areas of memory may be reserved for floating-point and fixed-point texture maps, and texture fetch unit 312 may determine the numerical format for a given texture map based on a memory address for the texel or map. Other techniques for distinguishing floating-point and fixed-point texture maps may also be implemented.
[0040] In accordance with an embodiment of the present invention, texture filtering unit 314 applies a suitable filter to the retrieved texels. In one embodiment, texture filtering unit 314 receives texture values and weights from texture fetch unit 312 and includes arithmetic circuitry for performing a filtering operation on the received values. Texture filtering unit 314 is advantageously configured to operate on both floating-point and fixed- point textures, and texture fetch unit 312 advantageously provides the format flag (or another format indicator) to texture filtering unit 314. After filtering, texture filtering unit 314 returns a result to shader 308 for further processing, e.g., blending with an underlying fragment color or surface normal.
[0041] In addition to texture blending, shader 308 may also apply other effects, including various lighting and/or fog effects known in the art, to compute a final fragment color, and shader 308 may include components (not shown) related to such computations. Ultimately, shader 308 produces a color value (e.g., in RGBα format) for each fragment. These color values may be stored, e.g., in graphics memory 216 or elsewhere.
[0042] Raster operations module 310 performs various operations on the array of fragment color values generated by shader 308. For example, where rasterizer 306 generates an oversampled fragment array, raster operations module 310 may downfilter the fragment data to match the pixel resolution of a display device. The final pixel color values generated by raster operations module 310 are stored in pixel buffer 226 for subsequent scanout by scanout module 224.
[0043] It will be appreciated that the rendering pipeline described herein is illustrative and that variations and modifications are possible. The division of rendering functions among various functional blocks described herein is made for purposes of description, and it is to be understood that different divisions (e.g., division into more or fewer functional blocks) might be made and that different components of the pipeline may share some circuitry. The rendering pipeline is advantageously implemented such that different components can operate concurrently on different data. In addition, each module within the rendering pipeline may also operate in pipelined fashion. A rendering pipeline may include multiple instances of any or all of the modules described herein (e.g., multiple shader modules that operate on different fragments in parallel), thereby boosting overall rendering speed. Additionally, multiple instances of the entire rendering pipeline might be implemented in a single graphics processor.
[0044] A texture filtering unit according to an embodiment of the present invention will now be described. For purposes of illustration, particular fixed-point and floating-point formats for binary encoding of real numbers are used herein. Fixed-point formats are identified herein by the notation (sM.N) or (uM.N), where "s" indicates a signed format, "u" indicates an unsigned format, M is the number of bits before the decimal point, and N is the number of bits after the decimal point. For instance, (s2.14) uses a total of 16 bits to encode numbers in the range (-4, 4). In one embodiment, the texture filtering unit uses an internal unsigned format with a positive bias; for example (u2.14) can be used to represent the same range as (s2.14) if numbers are biased upward by adding 4.0 (represented as a bit field 0x8000) to the 16-bit field; such biasing is known in the art.
[0045J Floating-point formats used herein include a mantissa having some number of bits (which may include a sign bit) and an exponent having some number of bits (generally fewer bits than the mantissa, although this is not required). The value V of a floating-point number is its mantissa (m) multiplied by 2 raised to the power of the exponent (x); i.e., V- /71*2*. The mantissa may be expressed in any convenient fixed-point format and is not constrained to being in any particular format or range. For example, a block floating-point format used herein has a mantissa in (s2.14) or (s2.22) format and a 5-bit exponent. As another example, "fplό" format, as used herein, is a 16-bit floating-point format based on IEEE 754 encoding standards. In fplό format, a number is represented by a sign bit, five exponent bits, and ten mantissa bits. The five exponent bits are biased by +15, and the ten mantissa bits represent the fractional portion of the mantissa, with an implicit "1" preceding the decimal point. Certain values (based on the IEEE 754 standard) are reserved to indicate special numbers including underflows ("Denorms"), zero, positive and negative infinity (INF), and undefined ("not a number," or NaN) values. It is to be understood that other formats may be substituted for any of the specific formats used as examples herein.
[0046] Fig. 4 is a simplified block diagram of a texture filtering unit 400 according to an embodiment of the present invention. Texture filtering unit 400 provides a floating-point wrapper around a conventional fixed-point bilinear interpolation circuit and is configurable for filtering either fixed-point or floating-point texture data. Texture filtering unit 400 includes a floating-point preprocessing block 402, an input selection circuit 404, a fixed-point bilinear interpolation (Bilerp) circuit 406, an accumulator circuit 408 that performs both fixed-point and floating-point accumulation, a fixed-point (s2.14) formatting circuit 410, a floating-point (fplό) format conversion circuit 412, and an output selection circuit 414.
[0047] Texture filtering unit 400 advantageously communicates with other components (not shown) that supply input data including texture values (a, b, c, d) for a fragment and weights (ws, wt, wj) to be used during filtering. The input data advantageously also include a format signal (FMT) indicating whether the texture values are in a fixed-point or floating-point format. In one embodiment, texture filtering unit 400 implements texture filter unit 314 of shader 308 (Fig. 3) and receives input data from texture fetch unit 312 and/or other control circuitry (not shown) in shader 308. Examples of suitable control circuits are known in the art, and a detailed description is omitted as not being critical to understanding the present invention.
[0048] Fixed-point texture filtering is provided by fixed-point Bilerp circuit 406, which may be of generally conventional design, and accumulator circuit 408, which advantageously handles both fixed point and floating point formats as described below. In one embodiment, fixed-point Bilerp circuit 406 receives as inputs four fixed-point texture values (a, b, c, d) and two weights (ws, wt). These inputs are used to implement a conventional bilinear filter (e.g., Eq. 1) that produces a filtered value λ/.
[0049] More complex filters, such as trilinear filters or anisotropic filters, can be implemented by passing multiple groups of texture values and associated weights to Bilerp circuit 406 and accumulating a weighted average of the results λ/ from each pass in accumulator circuit 408. Accumulator circuit 408 is advantageously configured to multiply each received filter result λ/by a corresponding weight vv/and add the product to a running total (λA). Where the desired filter entails just one bilinear filtering pass, accumulator circuit 408 can be instructed to accumulate one result λ/with a weight vv/= 1. For more complex filters, such as trilinear or anisotropic filtering, any number of bilinear filtering passes may be accumulated with weights ny determined in accordance with the particular filtering algorithm. The number of passes to be accumulated and a weight vty- for each pass may be provided as input parameters to accumulator circuit 408 (e.g., by control circuits of shader 308 as mentioned above); when the specified number of passes has been reached, accumulator circuit 408 provides its output XA to fixed-point formatting circuit 410.
[0050] Bilerp circuit 406 and accumulator circuit 408 may support any desired fixed- point format, such as (s2.14). In one embodiment, Bilerp circuit 406 receives (s2.14) texture values, biases each value upward by 32K (effectively converting the values to an unsigned representation), applies the bilinear filter, and biases the result downward by 4.0 to determine λ/. The weights ws, wt, and vv/may be in a different format, e.g., (ul.9) for weights in the range [0, I]. In some embodiments, accumulator circuit 408 advantageously preserves a larger number of bits than Bilerp circuit 406 in order to reduce or eliminate rounding errors that can occur when filter results are multiplied by weights less than 1. For example, fixed-point filter circuit 406 may use (s2.14) format while accumulator circuit 408 uses (s2.22). Fixed-point formatting circuit 410 is provided to convert the internal format of accumulator circuit 408 to the final fixed-point foπnat in the event that different formats are used; for instance, conversion from (s2.22) to (s2.14) can be performed by simply dropping LSBs or by rounding.
[0051] Floating-point texture filtering is provided by fixed-point Bilerp circuit 406 in cooperation with preprocessing block 402, accumulator circuit 408, and floating-point format conversion circuit 412. This embodiment exploits the linearity of the filtering algorithm to implement floating-point filtering using fixed-point arithmetic circuits. In general, as is known in the art, a linear filter F(a, b, c, d), such as the bilinear filter of Eq. 1, has the property that for any nonzero scalar q:
F{qa, qb, qc, qd) = q *F(a, b, c, d). (Eq. 2)
[0052] Preprocessing block 402 of texture filter 400 prescales the input floating-point texture values (a, b, c, d) by a factor q — 2~k, where the block exponent k is selected based on respective exponent fields of the floating-point values (a, b, c, d). With an appropriate selection of block exponent k, the prescaled floating-point values:
a' = a*T*, b' = b*T*, c' = c*2-k, d = d*2~k (Eq. 3) are in a suitable range for conversion to a fixed-point format, e.g., (s2.14).
[0053] The prescaled texture values (a', b', c', d') are provided (in the fixed-point format) to fixed-point Bilerp circuit 406, which generates a filtered mantissa value:
λf'= F(a', b\ c', d) = 2'k*F(a, b, c, d), (Eq. 4) where the right-hand equality holds as long as Bilerp circuit 406 implements a linear filter.
[0054] For floating-point filtering, accumulator circuit 408 receives the prescale factor (block exponent k) in addition to the filtered mantissa value λ/ and obtains the desired floating-point result:
2f= F(a, b, c, d) = λ/ * 2k. (Eq. 5)
[0055] As noted above, accumulator circuit 408 is advantageously configurable to accumulate Bilerp results λ/ and block exponents k over multiple passes, with each result being weighted by a respective weight w/, any filtering algorithm that can be performed for fixed-point texture data can also be performed for floating-point texture data.
[0056J When accumulation is complete, accumulator circuit 408 provides the accumulated results (a mantissa λA and a block exponent kA) to format conversion circuit 412. Foπnat conversion circuit 412 converts the floating-point number represented by mantissa λA and block exponent kA to a standard floating-point foπnat (e.g., fpl6).
[0057] Texture filtering unit 400 is advantageously configurable so that fixed-point or floating-point filtering can be dynamically selected. To support dynamic format selection, input selection circuit 404 and output selection circuit 414 are provided. Selection circuits 404, 414 are controlled by a foπnat selection (FMT) signal that indicates whether the input texture data is in fixed-point format or floating-point format. These circuits may be implemented, e.g., using conventional multiplexers.
[0058] In operation, texture data values (a, b, c, d) are provided to texture filtering unit 400 in either fixed-point or floating-point format. These texture data values may correspond to any attribute of a texture for which filtering is desired, including color (or individual color components), surface normal, or any other attribute. The format signal FMT, which may be generated, e.g., by a texture fetch unit as described above, is also provided in an appropriate state to indicate whether the texture data is in fixed-point or floating-point format. For fixed-point data, input selection circuit 404 provides the fixed- point values {a, b, c, d) directly to Bilerp circuit 406, ignoring the output of preprocessing block 402, and output selection circuit 414 selects the output of the fixed-point data path (provided by fixed-point formatting circuit 410) as the final output AQ, ignoring the output of the floating-point data path (provided by format conversion circuit 412). For floating¬ point data, input selection circuit 404 selects the prescaled outputs (a1, b', d , d') as fixed- point inputs to Bilerp circuit 406, and output selection circuit 414 selects the output of the floating-point data path as the final output XQ, ignoring the output of the fixed-point data path.
[0059] In some embodiments, format signal FMT may also be used to disable components of filter 400 that are not active at a given time. For instance, fixed-point formatting circuit 410 may be disabled when the input data is floating-point; for fixed- point data, preprocessing block 402 and floating-point format conversion circuit 412 may be disabled. In some embodiments, for fixed-point input data, the block exponent k provided by preprocessing block 402 may be set to zero or another convenient value.
[0060] Specific implementations of the floating-point circuits of texture filtering unit 400 will now be described. Fig. 5 is a block diagram of an implementation of preprocessing block 402 according to an embodiment of the present invention.
Preprocessing block 402 converts floating-point texture values {a, b, c, d) in fplό format to fixed-point values (a', b', d , d') in (s2.14) format by prescaling the inputs using a block exponent k. Preprocessing block 402 includes a special number circuit 504 and a prescaling block 506.
[0061] Special number circuit 504 receives the floating-point texture values (a, b, c, d) and the associated weights (ws, W1); detects any special numbers (e.g., INF, NaN); and where appropriate, generates a special number output λs on signal path 522 and a bypass signal on signal path 524 that are used in subsequent circuits to cause the special number output λs to override the result of Bilerp circuit 406. As described below, these signals facilitate emulation of the special-number arithmetic of a floating-point texture filter.
[0062] In one embodiment, the following rules for handling fplό special numbers are implemented: First, any NaN or INF texture value that is to be multiplied by a zero weight is replaced with a zero and processed in the normal manner. Second, if a NaN texture value is to be multiplied by a nonzero weight, the special number output λs is set to a canonical NaN and the bypass signal is asserted. Fourth, if +INF and -INF are to be added together, the special number output λs is set to NaN and the bypass signal is asserted. Third, if a positive (negative) INF texture value is to be multiplied by a nonzero weight, the special number output λs is set to positive (negative) INF and the bypass signal is asserted. In all other cases, the texture values are passed through unaltered and the bypass signal is deasserted; λs may be set to any convenient value (e.g., zero). As will be seen below, these special number rules result in correct modeling of a floating-point bilinear filter. It will be appreciated that conventional logic circuitry for detecting special numbers may be used to implement these rules and that different rules for handling special numbers might also be implemented.
[0063] Prescaling block 506, which determines the block exponent k, includes an exponent extraction circuit 508, a four-way comparison circuit 510, an exponent subtraction (ESUB) circuit 512, and an (s2.14) format conversion circuit 514. Exponent extraction circuit 508 extracts the exponent bits from each of inputs (a, b, c, d) and provides the exponents (denoted by a.e, b.e, c.e, d.e) to four- way comparison circuit 510. Four-way comparison circuit 510 selects the largest of the four exponents as block exponent k. In one embodiment, four- way comparison circuit 510 may perform two-way comparisons between pairs of inputs (a.e, b.e) and (c.e, d.e) to select the larger of each pair, then perform a two-way comparison on the results of the first two comparisons; any conventional comparison circuitry may be used.
[0064] To prescale the inputs (a, b, c, d) by
Figure imgf000020_0001
ESUB circuit 512 subtracts the value k from the exponent portion of each input, resulting in prescaled inputs (a1, b', c', d'). ESUB circuit 512 is advantageously configured to handle any exponent underflows correctly (e.g., by right-shifting mantissa bits or flushing inputs to zero as appropriate). Where the largest of the four exponents is chosen as block exponent k, the largest prescaled input (a1, b' , c' , d') has an absolute value in the range [1, 2), while the other prescaled inputs have absolute values in the range [0, 2).
[0065] Format conversion circuit 514 converts the prescaled fpl6 values to a fixed-point (s2.l4) representation. Since the prescaled values have absolute values less than 2, the fixed-point representation does not overflow; any underflows are flushed to zero. Conventional format conversion circuits and techniques may be used to implement format conversion circuit 514, and circuit 514 may convert the numbers to any format that is appropriate for inputs to Bilerp circuit 406.
[0066] The prescaling factor (exponent k) is provided to accumulator circuit 408. In the event that the inputs are in fixed-point format, selection circuit 516, which may be, e.g., a conventional multiplexer controlled by the format selection signal FMT, can be used to set block exponent k to zero, thereby establishing a scaling factor of 1 for all fixed-point inputs.
[0067] It will be appreciated that the preprocessing circuit described herein is illustrative and that variations and modifications are possible. For example, rather than selecting the largest exponent as the block exponent for prescaling, a different number might be chosen. For a given embodiment, an optimal choice of block exponent may depend in part on the particular fixed-point format used by Bilerp circuit 406. [0068] Referring again to Fig. 4, for floating-point texture inputs, the prescaled texture values (a1, b', c', d') from preprocessing circuit 402 are provided to fixed-point Bilerp circuit 406 by input selection circuit 404 as described above. Bilerp circuit 406 applies a bilinear filter and provides the (fixed-point) result Xf to accumulator circuit 408. It should be noted that the operation of Bilerp circuit 406 is advantageously independent of whether the inputs were received via the fixed-point or floating-point input path; thus conventional fixed-point Bilerp circuits may be used without modification.
[0069] Fig. 6 is a simplified block diagram of accumulator circuit 408 according to an embodiment of the present invention. As described above, accumulator circuit 408 is provided with weights uy for computing a weighted sum of results of multiple passes through Bilerp circuit 406. In the case of floating-point data, accumulator circuit 408 reintroduces the block exponent k associated with each pass. (Because prescale block 506 described above advantageously selects the block exponent k independently for each pass, k will generally be different for different passes.)
[0070] In addition, accumulator circuit 408 advantageously implements rules for handling cases where the floating-point input texture data includes a special number (e.g., NaN or INF) in a manner that emulates the behavior of a floating-point bilinear filter circuit. For instance, in an fpl6 floating-point filter, it would be expected that if one of the input texture values is NaN (or INF), the result should also be NaN (or INF). Such behavior can be implemented by using the special value λs (lines 522) and the bypass signal (line 524) provided by special number circuit 504 (Fig. 5) to override the results of Bilerp circuit 406.
[0071] Floating-point accumulation in the normal case (i.e., where the bypass signal is not asserted) will be described first. As shown in Fig. 6, accumulator circuit 408 includes a register 602 for storing an accumulated mantissa value λA and a register 604 for storing an accumulated block exponent kA. Accumulated mantissa λA is advantageously stored in a fixed-point (s2.22) format, and block exponent kA is stored as an integer (e.g., an unsigned 5 bit integer with a +15 bias to cover the full range of possible fpl6 exponents). Registers 602 and 604 are updated as results of each filter pass are received and are read out to output stage 412 when accumulation is complete.
[0072] Accumulator circuit 408 receives as inputs the current filter result λf, a weighting factor vv/to be applied to the current result, and the current block exponent k. Multiplier 606 multiplies λf by w/, providing the result as a current mantissa λj^. A floating-point addition module 608 interprets the current mantissa λ/w and block exponent A: as a block floating-point result λfw * 2k and adds this result to an accumulated block floating-point result λA * 2104. Specifically, floating-point addition module 608 determines which of current block exponent k and accumulated block exponent kA is larger, shifts one of the mantissas λA and λ/w so that both floating-point values are represented using the larger block exponent, then adds the mantissas, storing the sum as λΛ in register 602 and the larger block exponent as kA in register 604.
[0073] More specifically, floating-point addition module 608 includes a maximizer circuit 610 that selects the larger of k and kA as a new accumulated block exponent (kAo). A subtraction circuit 612 subtracts k from kAo, and a bit-shift circuit 614 right-shifts current mantissa λfw by (kAo - k) bits. Similarly, a subtraction circuit 616 subtracts kA from kAo, and a bit-shift circuit 618 right-shifts accumulated mantissa λA by (kA0 - kA) bits. (In general, the operation of circuits 610, 612, 614, 616, and 618 results in one mantissa being shifted by zero bits and the other by a non-negative number of bits.) Bit-shift circuits 614 and 616 advantageously provide their outputs in (s2.22) format to avoid loss of numerical precision.
[0074] Fixed-point addition circuit 620 adds the shifted mantissa values provided by bit- shift circuits 614 and 618 to produce a new accumulated mantissa λAo in (s2.22) format. In some embodiments, an overflow in fixed-point addition circuit 620 may result in kAo being incremented by 1 and λAo being right-shifted by 1. In other embodiments, kAo can be selected so that such an overflow does not occur. It should be noted that as long as the weights Wf implement a weighted average with the sum of all weights equal to 1.0 (as is usually the case for filtering) and all texture input values are finite (which is the case when the bypass signal is not asserted), the floating-point filter result remains finite. Thus, it is not necessary for addition module 608 to detect overflow situations in which the sum of two finite floating-point numbers results in a special number (e.g., NaN or INF) as is often done in general-purpose floating-point addition circuits.
[0075] When the bypass signal is not asserted, the new accumulated mantissa λAo and the new accumulated block exponent kAo are selected by selection circuit 624 and written to registers 602 and 604, respectively. [0076] When the bypass signal is asserted, the normal-case results λAo and kAo are overridden by a special value, as will now be described. The special value λs provided by special number circuit 504 (Fig. 5) on lines 522 is received at a format circuit 622, which reformats the fpl6 value into a block exponent kSo and a mantissa λso in (s2.22) format. In one embodiment, kso may be zero, and λso may include all bits of the fp 16 representation of λs, with the remaining bits set to zero. In response to the asserted state of the bypass signal on line 524, selection circuit 624 selects the special-number results (λso, kso), and these results are written to registers 602 and 604, respectively.
[0077| When a special number is written to register 602, a flag is advantageously set in a special flag register 626. Special flag register 626 can be used by various circuits to determine whether the value in register 602 is a normal mantissa or a special value, so that correct behavior for special numbers can be implemented. For example, addition circuit 620 may be configured to read special flag register 626 and to implement appropriate arithmetic rules for special numbers, e.g., that NaN added to any number results in NaN, etc. In some embodiments, whenever an INF or NaN value occurs as λs, the accumulated result will also be INF or NaN; accordingly, addition circuit 620 can be configured to simply pass through the special value λA in the event that the special number flag in register 626 is set.
[0078] When accumulation is complete, registers 602 and 604 can be read out to format conversion stage 412 (Fig. 4) in response to control signals (not shown), which may be generated using conventional techniques. Additional control signals (not shown) may be provided for resetting the stored values in registers 602 and 604 (e.g., to zero) and special flag register 626 to initialize accumulator circuit 408.
[0079J In the case of fixed-point texture data, the same accumulator circuit 408 may also be used. For example, as described above prescaling block 506 (Fig. 5) may be configured to provide block exponent k = 0 for each set of fixed-point inputs so that the "mantissas" (which, in this case, are fixed-point values) are not shifted. In one embodiment, special numbers are not defined in the fixed-point format, and the bypass signal would not be asserted during fixed-point accumulation; in other embodiments, special fixed-point numbers might be defined and detected. [0080] It wiN be appreciated that the accumulator circuit described herein is illustrative and that variations and modifications are possible. In some embodiments, the accumulation circuit may include a general-purpose floating-point addition circuit, with each received (λ/w, k) pair being converted to a suitable floating-point format prior to addition. Handling of special numbers may also be varied. For instance, the special- number bypass signal may be used to disable various elements of the accumulator circuit when the special value λs is to be selected, or different rules for handling special numbers might be implemented. In other embodiments, separate fixed-point and floating-point accumulator circuits may be implemented.
[0081] Fig. 7 is a block diagram of a floating-point format conversion circuit 412 according to an embodiment of the present invention. After accumulation is complete, format conversion circuit 412 receives the final output values λA and kA from registers 602 and 604 of accumulation circuit 408 (Fig. 6) and the special flag value from special flag register 626. Normal conversion circuit 704 and special conversion circuit 706 generate "normal" and special interpretations of the final output values λA and kA, respectively, in a desired output format (e.g., fpl6). The correct interpretation is selected by a selection circuit 708 based on the special flag value.
[0082] More specifically, in one embodiment, normal conversion circuit 704 generates an fpl6 value corresponding to λA * 21^. Conventional format-conversion techniques may be used. Special conversion circuit 706 converts λA to fpl6 format (e.g., by dropping any extra bits that were added by format circuit 622 described above). Selection circuit 708 selects between the normal value provided by normal conversion circuit 704 and the special value provided by special conversion circuit 706 based on whether the special flag (from register 626) is asserted. This selection is provided to output selection circuit 414 (Fig. 4) as the floating-point filtered texture value Λo. Other format conversion circuits may also be implemented for consistency with the internal and external floating-point formats in a particular embodiment. In some embodiments, the accumulator circuit maintains the accumulated result in the desired output format, and a separate format conversion stage may be omitted.
[0083] Thus, texture filtering unit 400 leverages a fixed-point Bilerp circuit to filter floating-point texture data and, for any floating-point inputs, can produce the same filtered result that would have been obtained using a floating-point Bilerp circuit. As described above, the behavior of a floating-point Bilerp circuit can be emulated for special number inputs as well as normal inputs. Those of ordinary skill in the art will recognize that underflows (e.g., fplό Denorms) are inherently handled properly by the circuits described above. Thus, use of a fixed-point Bilerp circuit for filtering floating-point data need not result in loss of numerical precision. The fixed-point and floating-point formats described herein can include any number of bits; in particular, additional bits may be used internally in order to reduce or eliminate rounding errors and truncated at the output stage.
[0084J It will be appreciated that leveraging a fixed-point filter circuit to filter floating¬ point data as described herein allows the texture filter unit to be more compact than comparable units with a dedicated floating-point filter circuit. In addition, the texture filtering unit described herein is capable of handling fixed-point or floating-point texture data at the same rate. (The rate depends on implementation details such as the input texel bandwidth; for instance, in one embodiment, a rate of two Bilerp operations per clock is supported.) To match this performance, a design with a floating-point filter circuit would need to include a separate, parallel fixed-point filter path, which would further increase chip area.
[0085J While the invention has been described with respect to specific embodiments, one skilled in the art will recognize that numerous modifications are possible. For instance, any fixed-point filter circuit that implements a linear filtering algorithm can be used in place of the Bilerp circuit described herein. The fixed-point filter circuit may be configured to filter any number of input values and may also be used to implement filters involving fewer input values, e.g., by setting values for any unused inputs to zero. In some embodiments, the accumulator circuit may be configured to accumulate filter results received from multiple fixed-point filter circuits that operate in parallel instead of or in addition to accumulating multiple results from one fixed-point filter circuit.
[0086] The texture values provided to the texture filter unit may include any texel attribute including but not limited to colors or color components, surface normals (or components thereof), and the like. In some embodiments, the texture filtering unit may be configured to filter multiple attributes in parallel.
[0087] Fixed-point and floating-point numbers may be expressed in any desired format, not limited to the particular examples described herein. The texture filter unit, or any component thereof, may use an internal representation for fixed-point and/or floating-point numbers that is identical to or different from the external representation. In some embodiments, multiple alternative floating-point (or fixed-point) formats may be supported, and appropriate format signals and/or reformatting units may be included to control and/or perform appropriate format conversions.
[0088] The various circuits described herein can be implemented using conventional techniques and may include, e.g., ASICs, programmable circuits configured with suitable program code, and other devices; electronic, optical, and/or mechanical circuit technologies may be used as desired. It is to be understood that while the present description makes reference to various functional blocks, these blocks are used solely for purposes of description and are not intended to limit the invention to particular physical configurations; circuitry implementing various operations may be shared or replicated among blocks as desired.
[0089] Graphics processors incorporating the texture filtering unit described herein may be adapted to a variety of computer systems, including general-purpose computer systems (desktops, laptops, etc.) and special-purpose computer systems (video game consoles, personal digital assistants, cell phones, etc.).
[0090] Thus, although the invention has been described with respect to specific embodiments, it will be appreciated that the invention is intended to cover all modifications and equivalents within the scope of the following claims.

Claims

WHAT IS CLAIMED IS:
1. In a graphics processor, a device for filtering floating-point texture data, the device comprising: a prescaling circuit configured to convert each one of a group of floating- point input texture values to a product of a fixed-point mantissa and a scaling factor, wherein the scaling factor is the same for each one of the group of floating-point input texture values; a fixed-point filtering circuit configured to compute a fixed-point filter output value from a plurality of fixed-point filter input values, the fixed-point filtering circuit being coupled to receive, as the fixed-point filter input values, the fixed-point mantissas for the group of floating-point input texture values; and an accumulator circuit coupled to receive the scaling factor from the prescaling circuit and the filter output value from the fixed-point filtering circuit, the accumulator circuit being configured to scale the filter output value by a reciprocal of the scaling factor, thereby generating a floating-point filter result.
2. The device of claim 1, wherein the accumulator circuit is further configured to accumulate a weighted sum of a plurality of floating-point filter results.
3. The device of claim 2, wherein each of the plurality of floating- point filter results is obtained by processing a group of texture values through the prescaling circuit and the fixed-point filtering circuit.
4. The device of claim 2, wherein each of the floating-point input texture values includes an exponent and wherein the prescaling circuit is further configured such that the scaling factor corresponds to a largest one of the exponents.
5. The device of claim 4, wherein the accumulator circuit includes: a storage circuit configured to store an accumulated floating-point filter result; a fixed-point multiplier circuit configured to multiply a current fixed-point filter output value received from the fixed-point filter circuit by a current weight, thereby computing a current mantissa; and a floating-point addition circuit configured to add a current floating-point value represented by the current mantissa and a current scaling factor received from the prescaling circuit to the accumulated floating-point filter result.
6. The device of claim 2, wherein the fixed-point filtering circuit is configured to implement a bilinear filter using four filter inputs.
7. The device of claim 6, wherein the accumulator circuit is further configured to compute a weighted average of floating-point filter results from two filter passes, thereby computing a trilinear filtered texture value.
8. The device of claim 6, wherein the accumulator circuit is further configured such that the weighted average corresponds to an anisotropically filtered texture value.
9. The device of claim 1, further comprising: a fixed-point input path configured to provide a group of fixed-point input texture values as the filter inputs to the fixed-point filtering circuit, the fixed-point input path being coupled to the fixed-point filtering circuit via a fixed-point input path that bypasses the prescaling circuit, wherein the device is configurable for operation using either fixed-point texture values or floating-point texture values as inputs.
10. The device of claim 9, wherein the accumulator circuit is further configured to be operable in either of a fixed-point mode and a floating-point mode.
11. The device of claim 10, wherein in the fixed-point mode, the accumulator circuit operates with the scaling factor equal to 1.
12. The device of claim 1, further comprising: a special number logic circuit coupled to receive the input floating-point texture values and configured to assert a special value signal in the event that one of the input floating-point texture values corresponds to a predetermined special number, wherein the floating-point accumulator circuit is further configured to receive the special value signal and to provide a corresponding special number as the floating-point filter result in the event that the special value signal is asserted.
13. A graphics processor having a shader module for computing a fragment color, the shader module comprising: a texture fetch unit configured to fetch a plurality of texture values corresponding to a fragment and to determine whether the fetched texture values are in a fixed-point format or a floating-point format; a texture filter unit coupled to receive the fetched texture values from the texture fetch circuit and configured to apply a filter to the fetched texture values, thereby generating a filter result, the texture filter unit being operable in either of a fixed-point mode and a floating-point mode, wherein the texture filter unit operates in the fixed-point mode in the event that the fetched texture values are in the fixed-point format and in the floating-point mode in the event that the fetched texture vales are in the floating-point format.
14. The graphics processor of claim 13, wherein the texture filter unit includes: a prescaling circuit configured to convert each one of a group of floating- point input texture values to a product of a fixed-point mantissa and a scaling factor, wherein the scaling factor is the same for each one of the group of floating-point input texture values; a fixed-point filtering circuit configured to compute a fixed-point filter output value from a plurality of fixed-point filter input values, the fixed-point filtering circuit being coupled to receive, as the fixed-point filter input values, the fixed-point mantissas for the group of floating-point input texture values; and an accumulator circuit coupled to receive the scaling factor from the prescaling circuit and the filter output value from the fixed-point filtering circuit, the floating-point accumulator circuit being configured to scale the filter output value by a reciprocal of the scaling factor, thereby generating a floating-point filter result.
15. The graphics processor of claim 14, wherein the texture filter unit further includes a fixed-point input path configured to provide a group of fixed-point input texture values as the filter inputs to the fixed-point texture filtering circuit, the fixed-point input path being coupled so as to bypass the prescaling circuit.
16. The graphics processor of claim 15, wherein the accumulator circuit is further configured to be operable in either of a fixed-point mode and a floating-point mode.
17. The graphics processor of claim 15, wherein the texture fetch unit further includes: an input selection circuit configured to select one of the prescaling circuit and the fixed-point input path as a source for the filter inputs to the fixed-point filtering circuit; and an output selection circuit configured to select, as a final result, one of the floating-point filter result from the floating-point accumulator circuit and the fixed-point filter result from the fixed-point accumulator circuit, wherein the floating-point filter result is selected by the output selection circuit in the event that the prescaling circuit is selected by the input selection circuit and the fixed-point filter result is selected by the output circuit in the event that the fixed-point input path is selected by the input selection circuit.
18. The graphics processor of claim 17, wherein the input selection circuit and the output selection circuit are controlled by a format signal, and wherein the texture fetch unit is configured to generate the format signal based on the determination of whether the fetched texture values are in the fixed-point format or the floating-point format.
19. A method for filtering texture data in a graphics processor, the method comprising the acts of: (a) receiving a group of floating-point texture values; (b) determining a scaling factor for the group of received texture values; (c) scaling each of the received texture values by the scaling factor; (d) converting each of the scaled texture values to a fixed-point format; (e) providing the converted texture values as filter inputs to a fixed-point texture filtering circuit configured to compute a fixed-point filter output from a plurality of filtered inputs; (f) receiving a filter output in a fixed-point format from the texture filtering circuit; and (g) scaling the filter output value by a reciprocal of the scaling factor, thereby generating a floating-point filter result.
20. The method of claim 19, further comprising the acts of: (h) determining whether any of the received texture values corresponds to a predetermined special number; and (i) providing a special number as the floating-point filter result in the event that one or more of the received texture values corresponds to a predetermined special number.
21. The method of claim 19, further comprising the act of: (h) accumulating, in a floating-point accumulator circuit, a weighted sum of a plurality of filter results, wherein each of the plurality of filter results is obtained by the acts (a) through (g).
22. The method of claim 19, further comprising the acts of: (h) receiving a group of fixed-point texture values; (i) providing the fixed-point texture values as filter inputs to the fixed-point texture filtering circuit; and (j) receiving a filter output in a fixed-point format from the texture filtering circuit.
23. The method of claim 22, further comprising: (k) accumulating, in a fixed-point accumulator circuit, a weighted sum of a plurality of filter outputs, wherein each of the plurality of filter outputs is obtained by the acts (h)-0).
PCT/US2005/027162 2004-08-04 2005-07-28 Filtering unit for floating-point texture data WO2006017410A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US10/912,419 2004-08-04
US10/912,419 US7355603B2 (en) 2004-08-04 2004-08-04 Filtering unit for floating-point texture data

Publications (2)

Publication Number Publication Date
WO2006017410A2 true WO2006017410A2 (en) 2006-02-16
WO2006017410A3 WO2006017410A3 (en) 2006-04-27

Family

ID=35756954

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2005/027162 WO2006017410A2 (en) 2004-08-04 2005-07-28 Filtering unit for floating-point texture data

Country Status (3)

Country Link
US (2) US7355603B2 (en)
CN (1) CN100442353C (en)
WO (1) WO2006017410A2 (en)

Families Citing this family (40)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7903892B2 (en) * 2002-10-29 2011-03-08 Ati Technologies Ulc Image analysis for image compression suitability and real-time selection
US7643679B2 (en) * 2003-02-13 2010-01-05 Ati Technologies Ulc Method and apparatus for block based image compression with multiple non-uniform block encodings
US8111928B2 (en) * 2003-02-13 2012-02-07 Ati Technologies Ulc Method and apparatus for compression of multi-sampled anti-aliasing color data
US7764833B2 (en) * 2003-02-13 2010-07-27 Ati Technologies Ulc Method and apparatus for anti-aliasing using floating point subpixel color values and compression of same
US7432925B2 (en) * 2003-11-21 2008-10-07 International Business Machines Corporation Techniques for representing 3D scenes using fixed point data
US7355603B2 (en) * 2004-08-04 2008-04-08 Nvidia Corporation Filtering unit for floating-point texture data
US7606429B2 (en) * 2005-03-25 2009-10-20 Ati Technologies Ulc Block-based image compression method and apparatus
US20070008333A1 (en) * 2005-07-07 2007-01-11 Via Technologies, Inc. Texture filter using parallel processing to improve multiple mode filter performance in a computer graphics environment
US7936359B2 (en) * 2006-03-13 2011-05-03 Intel Corporation Reconfigurable floating point filter
US8766995B2 (en) * 2006-04-26 2014-07-01 Qualcomm Incorporated Graphics system with configurable caches
US20070268289A1 (en) * 2006-05-16 2007-11-22 Chun Yu Graphics system with dynamic reposition of depth engine
US8884972B2 (en) * 2006-05-25 2014-11-11 Qualcomm Incorporated Graphics processor with arithmetic and elementary function units
US8869147B2 (en) * 2006-05-31 2014-10-21 Qualcomm Incorporated Multi-threaded processor with deferred thread output control
US8644643B2 (en) 2006-06-14 2014-02-04 Qualcomm Incorporated Convolution filtering in a graphics processor
US8766996B2 (en) * 2006-06-21 2014-07-01 Qualcomm Incorporated Unified virtual addressed register file
US20080001961A1 (en) * 2006-06-30 2008-01-03 Nokia Corporation High Dynamic Range Texture Filtering
US7649538B1 (en) * 2006-11-03 2010-01-19 Nvidia Corporation Reconfigurable high performance texture pipeline with advanced filtering
US7999821B1 (en) 2006-12-19 2011-08-16 Nvidia Corporation Reconfigurable dual texture pipeline with shared texture cache
US8443027B2 (en) * 2007-09-26 2013-05-14 International Business Machines Corporation Implementing a floating point weighted average function
US8502832B2 (en) * 2008-05-30 2013-08-06 Advanced Micro Devices, Inc. Floating point texture filtering using unsigned linear interpolators and block normalizations
US9093040B2 (en) * 2008-05-30 2015-07-28 Advanced Micro Devices, Inc. Redundancy method and apparatus for shader column repair
US8001422B1 (en) * 2008-06-30 2011-08-16 Amazon Technologies, Inc. Shadow testing services
US8352241B2 (en) * 2009-02-26 2013-01-08 Microsoft Corporation Emulating legacy hardware using IEEE 754 compliant hardware
US8516578B1 (en) 2010-12-22 2013-08-20 Google Inc. Vertex array access bounds checking
US8711166B1 (en) 2011-02-25 2014-04-29 Google Inc. Simulating non power of two texture behavior
US9508185B2 (en) * 2011-05-02 2016-11-29 Sony Interactive Entertainment Inc. Texturing in graphics hardware
US8416250B1 (en) * 2011-05-13 2013-04-09 Google Inc. Simulating vertex attribute zero
US9305368B2 (en) * 2013-06-21 2016-04-05 Intel Corporation Compression and decompression of graphics data using pixel region bit values
US9946331B2 (en) 2014-06-27 2018-04-17 Samsung Electronics Co., Ltd. System and method to process signals having a common component
US20170052762A1 (en) * 2015-08-20 2017-02-23 Futurewei Technologies, Inc. System and method for representing complex numbers in fused floating point
US10089708B2 (en) * 2016-04-28 2018-10-02 Qualcomm Incorporated Constant multiplication with texture unit of graphics processing unit
US10387991B2 (en) 2016-07-01 2019-08-20 Intel Corporation Method and apparatus for frame buffer compression
KR20180048081A (en) 2016-11-02 2018-05-10 삼성전자주식회사 Method and apparatus for processing texture
US11194585B2 (en) 2019-03-25 2021-12-07 Flex Logix Technologies, Inc. Multiplier-accumulator circuitry having processing pipelines and methods of operating same
CN112148371B (en) * 2019-06-27 2023-10-24 北京地平线机器人技术研发有限公司 Data operation method, device, medium and equipment based on single-instruction multi-data stream
US11455368B2 (en) * 2019-10-02 2022-09-27 Flex Logix Technologies, Inc. MAC processing pipeline having conversion circuitry, and methods of operating same
US11693625B2 (en) 2019-12-04 2023-07-04 Flex Logix Technologies, Inc. Logarithmic addition-accumulator circuitry, processing pipeline including same, and methods of operation
US11442881B2 (en) 2020-04-18 2022-09-13 Flex Logix Technologies, Inc. MAC processing pipelines, circuitry to control and configure same, and methods of operating same
US11604645B2 (en) 2020-07-22 2023-03-14 Flex Logix Technologies, Inc. MAC processing pipelines having programmable granularity, and methods of operating same
WO2023227064A1 (en) * 2022-05-26 2023-11-30 吕仁硕 Floating-point number compression method, operation apparatus, and calculator readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5951629A (en) * 1997-09-15 1999-09-14 Motorola, Inc. Method and apparatus for log conversion with scaling

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5745125A (en) * 1996-07-02 1998-04-28 Sun Microsystems, Inc. Floating point processor for a three-dimensional graphics accelerator which includes floating point, lighting and set-up cores for improved performance
KR19990078036A (en) * 1998-03-18 1999-10-25 추후제출 Method and apparatus for implementing efficient floating point Z-buffering
US6650327B1 (en) * 1998-06-16 2003-11-18 Silicon Graphics, Inc. Display system having floating point rasterization and floating point framebuffering
US6518974B2 (en) * 1999-07-16 2003-02-11 Intel Corporation Pixel engine
US6606097B1 (en) * 2000-08-03 2003-08-12 International Business Machines Corporation Circuit for generating frame buffer values
US7139005B2 (en) * 2003-09-13 2006-11-21 Microsoft Corporation Optimized fixed-point mathematical library and graphics functions for a software-implemented graphics rendering system and method using a normalized homogenous coordinate system
US7355603B2 (en) * 2004-08-04 2008-04-08 Nvidia Corporation Filtering unit for floating-point texture data

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5951629A (en) * 1997-09-15 1999-09-14 Motorola, Inc. Method and apparatus for log conversion with scaling

Also Published As

Publication number Publication date
US8098257B2 (en) 2012-01-17
CN100442353C (en) 2008-12-10
US7355603B2 (en) 2008-04-08
US20060028482A1 (en) 2006-02-09
WO2006017410A3 (en) 2006-04-27
US20080211827A1 (en) 2008-09-04
CN1993728A (en) 2007-07-04

Similar Documents

Publication Publication Date Title
US8098257B2 (en) Filtering unit for floating-point texture data
US10229529B2 (en) System, method and computer program product for implementing anti-aliasing operations using a programmable sample pattern table
US9978171B2 (en) Control of a sample mask from a fragment shader program
US7307628B1 (en) Diamond culling of small primitives
US7659893B1 (en) Method and apparatus to ensure consistency of depth values computed in different sections of a graphics processor
EP0933729A2 (en) Three-dimensional graphics accelerator
US7385611B1 (en) Decompression of block encoded texture data
US20100046846A1 (en) Image compression and/or decompression
US10055883B2 (en) Frustum tests for sub-pixel shadows
US8605104B1 (en) Threshold-based lossy reduction color compression
US7388588B2 (en) Programmable graphics processing engine
US20090295816A1 (en) Video graphics system and method of pixel data compression
US9024969B2 (en) Method and device for performing user-defined clipping in object space
US10019836B2 (en) Planar depth representations for block compression
US7466322B1 (en) Clipping graphics primitives to the w=0 plane
US20030169277A1 (en) Pipelined 2D viewport clip circuit
US6778188B2 (en) Reconfigurable hardware filter for texture mapping and image processing
US9305388B2 (en) Bit-count texture format
US20030160790A1 (en) End point value correction when transversing an edge using a quantized slope value
US6847378B2 (en) System and method for performing scale and bias operations by preclamping input image data
KR19990078036A (en) Method and apparatus for implementing efficient floating point Z-buffering
Kim et al. A 36 fps SXGA 3-D display processor embedding a programmable 3-D graphics rendering engine
KR20160077559A (en) Real time interal imaging method

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A2

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KM KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NG NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SM SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A2

Designated state(s): BW GH GM KE LS MW MZ NA SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IS IT LT LU LV MC NL PL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

DPEN Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed from 20040101)
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 200580026181.4

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase