High accuracy texture filtering in computer graphics
A texture filtering unit has inputs arranged to receive at least two texture values each clock cycle and a plurality of filter coefficients, the plurality of filter coefficients relating to a plurality of different texture filtering methods; hardware logic arranged to convert the input texture values to fixed-point representation; a coefficient merging logic block arranged to generate a single composite filter coefficient for each input texture value from the plurality of filter coefficients; one multiplier for each input texture value, wherein each multiplier is arranged to multiply one of the input texture values by its corresponding single composite filter coefficient; an addition unit arranged to add together outputs from each of the multipliers; hardware logic arranged to convert an output from the addition unit back to floating-point format; and an output arranged to output the converted output from the addition unit.
1 . A texture filtering unit implemented in hardware logic, wherein the texture filtering unit is configured to perform a filtering operation involving texture values input over N clock cycles for each of a plurality of streams of texture values, where N>1, the texture filtering unit comprising:
a plurality of inputs arranged to receive at least two texture values each clock cycle and a plurality of filter coefficients, the plurality of filter coefficients comprising coefficients relating to a combination of at least two of volumetric, anisotropic and trilinear texture filtering methods;
format conversion logic arranged to convert the input texture values from floating-point format to a fixed-point significand and an exponent;
a coefficient merging logic block arranged to generate a single composite filter coefficient for each input texture value from the plurality of filter coefficients comprising coefficients relating to a combination of at least two of volumetric, anisotropic and trilinear texture filtering methods, wherein the single composite filter coefficient is calculated independent of the input texture value;
one multiplier for each input texture value, wherein each multiplier is arranged to multiply the significand of one of the input texture values by its corresponding single composite filter coefficient;
an addition unit arranged, for each of the streams of texture values:
in a first clock cycle of the N clock cycles for the stream of texture values, to add together outputs from each of the multipliers;
in each of a second clock cycle to a Nth clock cycle of the N clock cycles for the stream of texture values, to add together outputs from each of the multipliers and a result of the addition from an immediately previous one of the N clock cycles for the stream of texture values; and
to output a result of the addition in the Nth clock cycle of the N clock cycles for the stream of texture values;
a mode and an interleaving counter logic block arranged to control operation of the addition unit such that in adjacent clock cycles, texture values are input from different streams of texture values to interleave the plurality of streams of texture values;
hardware logic arranged to convert an output from the addition unit from fixed-point format to floating-point format; and
an output arranged to output the converted output from the addition unit.
2 . The texture filtering unit according to claim 1 , wherein each input texture value comprises a sign bit, a plurality of exponent bits and a plurality of mantissa bits, the texture filtering unit further comprising a left shifting logic block for each input texture value,
and wherein the format conversion logic is configured to divide each input texture value into a fixed-point significand and an exponent, wherein the fixed-point significand of each input texture value is input to the corresponding multiplier and the second portion exponent of each input texture value is input to the corresponding left shifting logic block,
wherein the fixed-point significand of each input texture value comprises the sign bit and mantissa bits and the exponent of each input texture value comprises the exponent bits,
and wherein each left shifting logic block is arranged to left shift the output from a multiplier by an amount equal to the input exponent of a texture value and to output the left shifted output from the multiplier to the addition unit.
3 . The texture filtering unit according to claim 1 , wherein the mode and interleaving counter logic block comprises a counter arranged to count the N clock cycles and trigger the output of a result by the addition unit in the Nth clock cycle of the N clock cycles.
4 . The texture filtering unit according to claim 1 , wherein the inputs receive i texture values per clock cycle, the texture filtering unit comprises i multipliers and the coefficient merging logic block comprises a further i multipliers.
5 . The texture filtering unit according to claim 1 , wherein the texture filtering unit is arranged to perform texture filtering using any combination of two or more of: volumetric, anisotropic and trilinear texture filtering methods.
6 . The texture filtering unit according to claim 1 , wherein the addition unit comprises a fixed-point 3 adder arranged to add together a result of the addition from an immediately previous one of the N clock cycles and two newly received inputs, or a 3:2 compressor followed by a carry-save adder.
7 . The texture filtering unit according to claim 1 , wherein the interleaving counter logic block is arranged to receive enable signals, wherein the enable signals comprise values that specify whether each filtering method is enabled or not.
8 . A graphics processing unit comprising a texture filtering unit as set forth in claim 1 .
9 . A method of performing texture filtering in hardware logic, wherein the method performs a filtering operation involving textures values input over N clock cycles for each of a plurality of streams of texture values, where N>1, the method comprising:
receiving, in a texture filtering unit, at least two texture values each clock cycle and a plurality of filter coefficients, the plurality of filter coefficients comprising coefficients relating to a combination of at least two of volumetric, anisotropic and trilinear texture filtering methods;
converting the input texture values from floating-point format to a fixed-point significand and an exponent;
generating a single composite filter coefficient for each input texture value from the plurality of filter coefficients comprising coefficients relating to a combination of at least two of volumetric, anisotropic and trilinear texture filtering methods, wherein the single composite filter coefficient is calculated independent of the input texture value;
in each of a plurality of multipliers, multiplying the significand of one of the input texture values by its corresponding single composite filter coefficient, wherein the plurality of multipliers comprises one multiplier for each input texture value received in a clock cycle;
adding together outputs from each of the multipliers, wherein adding together outputs from each of the multipliers comprises:
in a first clock cycle of the N clock cycles for the stream of texture values, adding together outputs from each of the multipliers;
in each of a second clock cycle to a Nth clock cycle of the N clock cycles for the stream of texture values, adding together outputs from each of the multipliers and a result of the addition from an immediately previous one of the N clock cycles for the stream of texture values; and
outputting a result of the addition in the Nth clock cycle of the N clock cycles for the stream of texture values;
selecting a mode and controlling operation of the addition unit, wherein the plurality of streams of texture values are interleaved such that in adjacent clock cycles, texture values are input from different streams of texture values;
converting the result from fixed-point format to floating-point format; and
outputting the converted result.
10 . The method according to claim 9 , wherein each input texture value comprises a sign bit, a plurality of exponent bits and a plurality of mantissa bits,
wherein converting the input texture values from floating-point format to a fixed-point significand and an exponent comprises: dividing each input texture value into a fixed-point significand and an exponent, wherein the fixed-point significand of each input texture value is input to the corresponding multiplier and the exponent of each input texture value is input to the corresponding left shifting logic block,
wherein the fixed-point significand of each input texture value comprises the sign bit and mantissa bits and the exponent of each input texture value comprises the exponent bits, and wherein adding together outputs from each of the multipliers comprises:
for each of the plurality of multipliers, left shifting the output from the multiplier by an amount equal to the input exponent of a texture value and adding together the left shifted outputs from each of the multipliers.
11 . The method according to claim 9 , wherein the method performs a filtering operation involving texture values input over N clock cycles, where N>1, and wherein adding together outputs from each of the multipliers comprises:
in a first clock cycle of the N clock cycles, adding together outputs from each of the multipliers;
in each of a second clock cycle to a Nth clock cycle of the N clock cycles, adding together outputs from each of the multipliers and a result of the addition from an immediately previous one of the N clock cycles; and
outputting a result of the addition in the Nth clock cycle of the N clock cycles.
12 . The method according to claim 11 , further comprising:
counting the N clock cycles and triggering the output of a result of the addition in the Nth clock cycle of the N clock cycles.
13 . The method according to claim 9 , further comprising performing texture filtering using any combination of two or more of: volumetric, anisotropic and trilinear texture filtering methods.
14 . A graphics processing unit configured to perform the method as set forth in claim 9 .
15 . An integrated circuit manufacturing system comprising:
a non-transitory computer readable storage medium having stored thereon a computer readable dataset description of an integrated circuit that describes a texture filtering unit;
a layout processing system configured to process the integrated circuit description so as to generate a circuit layout description of an integrated circuit embodying the texture filtering unit; and
an integrated circuit generation system configured to manufacture the texture filtering unit according to the circuit layout description,
wherein the texture filtering unit is configured to perform a filtering operation involving texture values input over N clock cycles for each of a plurality of streams of texture values, where N>1, and the texture filtering unit comprises:
a plurality of inputs arranged to receive at least two texture values each clock cycle and a plurality of filter coefficients, the plurality of filter coefficients comprising coefficients relating to a combination of at least two of volumetric, anisotropic and trilinear texture filtering methods;
format conversion logic arranged to convert the input texture values from floating-point format to a fixed-point significand and an exponent;
a coefficient merging logic block arranged to generate a single composite filter coefficient for each input texture value from the plurality of filter coefficients comprising coefficients relating to a combination of at least two of volumetric, anisotropic or trilinear texture filtering methods, wherein the single composite filter coefficient is calculated independent of the input texture value;
one multiplier for each input texture value, wherein each multiplier is arranged to multiply the significand of one of the input texture values by its corresponding single composite filter coefficient;
an addition unit arranged, for each of the streams of texture values:
in a first clock cycle of the N clock cycles for the stream of texture values, to add together outputs from each of the multipliers;
in each of a second clock cycle to a Nth clock cycle of the N clock cycles for the stream of texture values, to add together outputs from each of the multipliers and a result of the addition from an immediately previous one of the N clock cycles for the stream of texture values; and
to output a result of the addition in the Nth clock cycle of the N clock cycles for the stream of texture values;
a mode and an interleaving counter logic block arranged to control operation of the addition unit such that in adjacent clock cycles, texture values are input from different streams of texture values to interleave the plurality of streams of texture values;
hardware logic arranged to convert an output from the addition unit from fixed-point format to floating-point format; and
an output arranged to output the converted output from the addition unit.