JP4784446B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP4784446B2
JP4784446B2 JP2006235272A JP2006235272A JP4784446B2 JP 4784446 B2 JP4784446 B2 JP 4784446B2 JP 2006235272 A JP2006235272 A JP 2006235272A JP 2006235272 A JP2006235272 A JP 2006235272A JP 4784446 B2 JP4784446 B2 JP 4784446B2
Authority
JP
Japan
Prior art keywords
texture
cache memory
texture data
external memory
given
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
JP2006235272A
Other languages
Japanese (ja)
Other versions
JP2008059266A (en
Inventor
雅之 中村
誠 安達
たかね 米本
幸治 西河
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Semiconductor Ltd
Original Assignee
Fujitsu Semiconductor Ltd
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 Fujitsu Semiconductor Ltd filed Critical Fujitsu Semiconductor Ltd
Priority to JP2006235272A priority Critical patent/JP4784446B2/en
Publication of JP2008059266A publication Critical patent/JP2008059266A/en
Application granted granted Critical
Publication of JP4784446B2 publication Critical patent/JP4784446B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、コンピュータ・グラフィックスにおいて、テクスチャ・マッピングを行う場合に使用して好適な画像処理装置に関する。   The present invention relates to an image processing apparatus suitable for use in texture mapping in computer graphics.

テクスチャ・マッピングは、描画するオブジェクトの表面にテクスチャを貼り付けることにより写実性の高い描画を行う手法である。図2はテクスチャ・マッピングの例を示しており、この例では、オブジェクト表面の一部分である三角形1にテクスチャ2の三角形ABCの部分を貼り付ける場合を示している。なお、(x、y)はオブジェクト座標、(s、t)はテクスチャ座標を示している。   Texture mapping is a technique for performing highly realistic drawing by pasting a texture onto the surface of an object to be drawn. FIG. 2 shows an example of texture mapping. In this example, the triangle ABC part of the texture 2 is pasted on the triangle 1 which is a part of the object surface. Note that (x, y) represents object coordinates, and (s, t) represents texture coordinates.

図3はテクスチャ・マッピングを行う場合に使用される従来の画像処理装置の一例を外部メモリと共に示す図である。図3中、5はテクスチャデータを格納する外部メモリであり、例えば、4096×4096テクセルの容量を持ち、テクスチャデータを格納するものである。6は従来の画像処理装置の一例であり、演算部7〜9、判定部10、セレクタ11、アドレス生成部12、13、セレクタ14、キャッシュメモリ15、セレクタ16及びピクセル加工部17などを備えている。   FIG. 3 is a diagram showing an example of a conventional image processing apparatus used when texture mapping is performed together with an external memory. In FIG. 3, reference numeral 5 denotes an external memory for storing texture data, which has a capacity of, for example, 4096 × 4096 texels and stores texture data. 6 is an example of a conventional image processing apparatus, and includes arithmetic units 7 to 9, a determination unit 10, a selector 11, an address generation unit 12, 13, a selector 14, a cache memory 15, a selector 16, a pixel processing unit 17, and the like. Yes.

演算部7は、オブジェクト座標系でのy方向への1ピクセル分の変化に対するテクスチャを貼り付ける三角形のx座標増分値dx/dy及びテクスチャのs座標増分値ds/dy、t座標増分値dt/dy、q座標増分値dq/dyを演算するものである。   The calculation unit 7 adds an x-coordinate increment value dx / dy of a triangle to which a texture is applied to a change of one pixel in the y direction in the object coordinate system, an s-coordinate increment value ds / dy, and a t-coordinate increment value dt / dy, q coordinate increment value dq / dy is calculated.

演算部8は、演算部7による演算結果から、オブジェクト座標系でのx方向への1ピクセル分の変化に対するテクスチャのs座標増分値ds/dx、t座標増分値dt/dx、q座標増分値dq/dxを演算するものである。   The calculation unit 8 calculates the texture s-coordinate increment value ds / dx, t-coordinate increment value dt / dx, and q-coordinate increment value for the change of one pixel in the x direction in the object coordinate system from the calculation result of the calculation unit 7. dq / dx is calculated.

演算部9は、演算部7、8の演算結果から、テクスチャを貼り付ける三角形の内部の各ピクセル(x、y)に対応するテクスチャ座標(s、t、q)を演算する演算部である。判定部10は、キャッシュメモリ15にキャッシングされているテクスチャデータのタグ情報から、キャッシュメモリ15内に演算部9が演算したテクスチャ座標(s、t)のテクスチャデータがあるか否かを判定するものである。   The calculation unit 9 is a calculation unit that calculates the texture coordinates (s, t, q) corresponding to each pixel (x, y) inside the triangle to which the texture is pasted from the calculation results of the calculation units 7 and 8. The determination unit 10 determines whether there is texture data of texture coordinates (s, t) calculated by the calculation unit 9 in the cache memory 15 from the tag information of the texture data cached in the cache memory 15. It is.

判定部10が、キャッシュメモリ15内に、演算部9が演算したテクスチャ座標(s、t)のテクスチャデータがあると判定した場合には、キャッシュメモリ15からのテクスチャデータの読み出しが行われる。これに対して、判定部10は、キャッシュメモリ15内に、演算部9が演算したテクスチャ座標(s、t)のテクスチャデータがないと判定した場合には、演算部9が演算したテクスチャ座標(s、t、q)をセレクタ11を介してアドレス生成部12又はアドレス生成部13に与える。   When the determination unit 10 determines that the texture data of the texture coordinates (s, t) calculated by the calculation unit 9 is present in the cache memory 15, the texture data is read from the cache memory 15. On the other hand, if the determination unit 10 determines that there is no texture data of the texture coordinates (s, t) calculated by the calculation unit 9 in the cache memory 15, the texture coordinates ( s, t, q) are given to the address generator 12 or the address generator 13 via the selector 11.

セレクタ11は、キャッシュメモリ15を有効とするか無効とするかを設定するためのキャッシュメモリ有効/無効設定信号に選択動作を制御され、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を有効としている場合は、判定部10が出力するテクスチャ座標(s、t、q)をアドレス生成部12に与え、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を無効としている場合は、判定部10が出力するテクスチャ座標(s、t、q)をアドレス生成部13に与えるものである。   The selector 11 is controlled in its selection operation by a cache memory valid / invalid setting signal for setting whether the cache memory 15 is valid or invalid, and the cache memory valid / invalid setting signal validates the cache memory 15. In this case, the texture coordinates (s, t, q) output from the determination unit 10 are given to the address generation unit 12, and the determination unit 10 outputs the cache memory valid / invalid setting signal invalidating the cache memory 15. The texture coordinates (s, t, q) are given to the address generation unit 13.

アドレス生成部12は、セレクタ11を介して判定部10からテクスチャ座標(s、t、q)が与えられたときは、テクスチャ座標(s、t)のテクスチャデータを含む所定の大きさのブロックのテクスチャデータを外部メモリ5から読み出すために必要なアドレスを生成して出力するものである。   When the texture coordinate (s, t, q) is given from the determination unit 10 via the selector 11, the address generation unit 12 has a block of a predetermined size including the texture data of the texture coordinate (s, t). An address necessary for reading texture data from the external memory 5 is generated and output.

アドレス生成部13は、セレクタ11を介して判定部10からテクスチャ座標(s、t、q)が与えられたときは、テクスチャ座標(s、t)のテクスチャデータを外部メモリ5から読み出すために必要なアドレスを生成して出力するものである。   The address generation unit 13 is necessary for reading the texture data of the texture coordinates (s, t) from the external memory 5 when the texture coordinates (s, t, q) are given from the determination unit 10 via the selector 11. A simple address is generated and output.

セレクタ14は、キャッシュメモリ有効/無効設定信号に選択動作を制御され、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を有効としている場合は、アドレス生成部12が出力するアドレスを外部メモリ5に与え、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を無効としている場合は、アドレス生成部13が出力するアドレスを外部メモリ5に与えるものである。   The selector 14 is controlled in selection operation by the cache memory valid / invalid setting signal. When the cache memory valid / invalid setting signal validates the cache memory 15, the selector 14 gives the external memory 5 the address output by the address generator 12. When the cache memory valid / invalid setting signal invalidates the cache memory 15, the address output from the address generator 13 is given to the external memory 5.

キャッシュメモリ15は、外部メモリ5が格納しているテクスチャデータの一部を所定の大きさのブロック単位で保持させるためのものであり、例えば、64×64テクセルの容量を持つものである。   The cache memory 15 is for holding a part of the texture data stored in the external memory 5 in units of blocks of a predetermined size, and has a capacity of 64 × 64 texels, for example.

セレクタ16は、キャッシュメモリ有効/無効設定信号に選択動作を制御され、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を有効としている場合は、キャッシュメモリ15から読み出されるテクスチャデータをピクセル加工部17に与え、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を無効としている場合は、外部メモリ5から読み出されるテクスチャデータをピクセル加工部17に与えるものである。   The selector 16 is controlled by the cache memory valid / invalid setting signal, and when the cache memory valid / invalid setting signal enables the cache memory 15, the texture data read from the cache memory 15 is sent to the pixel processing unit 17. When the cache memory valid / invalid setting signal invalidates the cache memory 15, the texture data read from the external memory 5 is given to the pixel processing unit 17.

ピクセル加工部17は、セレクタ16を介して与えられるキャッシュメモリ15又は外部メモリ5から読み出したテクスチャデータを使用してテクスチャを貼り付ける三角形の内部のピクセルの加工を行うものである。   The pixel processing unit 17 processes the pixels inside the triangle to which the texture is pasted using the texture data read from the cache memory 15 or the external memory 5 given through the selector 16.

このように構成された従来の画像処理装置6においては、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を有効としている場合において、テクスチャを貼り付ける三角形に使用するテクスチャデータがキャッシュメモリ15にある場合には、キャッシュメモリ15からテクスチャデータが読み出されてピクセル加工部17に与えられる。   In the conventional image processing apparatus 6 configured as described above, when the cache memory valid / invalid setting signal enables the cache memory 15, the texture data used for the triangle to which the texture is to be pasted is in the cache memory 15. First, texture data is read from the cache memory 15 and given to the pixel processing unit 17.

また、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を有効としている場合において、テクスチャを貼り付ける三角形に使用するテクスチャデータがキャッシュメモリ15にない場合には、そのテクスチャデータを含む所定の大きさのブロックのテクスチャデータが外部メモリ5からキャッシュメモリ15にキャッシングされた後、テクスチャを貼り付ける三角形に使用するテクスチャデータがキャッシュメモリ15から読み出されてピクセル加工部17に与えられる。   Further, when the cache memory valid / invalid setting signal indicates that the cache memory 15 is valid and the cache memory 15 does not have texture data to be used for the triangle to which the texture is to be pasted, the cache memory 15 has a predetermined size including the texture data. After the texture data of the block is cached from the external memory 5 to the cache memory 15, the texture data used for the triangle to which the texture is pasted is read from the cache memory 15 and given to the pixel processing unit 17.

また、キャッシュメモリ有効/無効設定信号がキャッシュメモリ15を無効としている場合には、判定部10は、テクスチャを貼り付ける三角形に使用するテクスチャデータはキャッシュメモリ15にないと判定する。この結果、アドレス生成部13は、判定部10から与えられるテクスチャ座標(s、t)のテクスチャデータを読み出すためのアドレスを生成して外部メモリ5に与え、そして、この結果、外部メモリ5から読み出されたテクスチャデータがピクセル加工部17に与えられる。即ち、テクスチャを貼り付ける三角形の内部の1ピクセルごとのテクスチャデータが外部メモリ5からピクセル加工部17に与えられる。   When the cache memory valid / invalid setting signal invalidates the cache memory 15, the determination unit 10 determines that the texture data used for the triangle to which the texture is to be pasted is not in the cache memory 15. As a result, the address generation unit 13 generates an address for reading the texture data of the texture coordinates (s, t) given from the determination unit 10 and gives it to the external memory 5, and as a result, reads from the external memory 5. The outputted texture data is given to the pixel processing unit 17. That is, texture data for each pixel inside the triangle to which the texture is pasted is given from the external memory 5 to the pixel processing unit 17.

このように、従来の画像処理装置6は、キャッシュメモリ15を設け、外部メモリ5が格納しているテクスチャデータの一部をキャッシュメモリ15にキャッシングすることにより、外部メモリ5に対するアクセス発生数を減らし、描画処理の高速化を図ることができるようにしている。
特開平10−11594号公報 特開平10−334273号公報 特開2003−196674号公報
As described above, the conventional image processing apparatus 6 includes the cache memory 15 and caches a part of the texture data stored in the external memory 5 in the cache memory 15, thereby reducing the number of accesses to the external memory 5. The drawing process can be speeded up.
Japanese Patent Laid-Open No. 10-11594 JP 10-334273 A Japanese Patent Laid-Open No. 2003-196664

図4は従来の画像処理装置6が有する問題点を説明するための図である。図4中、20はテクスチャ、21〜25はオブジェクト表面上のテクスチャ20を貼り付ける四角形を示している。   FIG. 4 is a diagram for explaining the problems of the conventional image processing apparatus 6. In FIG. 4, reference numeral 20 denotes a texture, and reference numerals 21 to 25 denote squares to which the texture 20 on the object surface is attached.

四角形21は、回転させていない状態を示している。この場合には、四角形21の外郭線26、27に着目した場合のオブジェクト座標系でのx方向への1ピクセル分の変化に対するテクスチャ20のs座標増分値ds/dx=1、t座標増分値dt/dx=0となり、オブジェクト座標系でのy方向への1ピクセル分の変化に対するオブジェクト20のs座標増分値ds/dy=0、t座標増分値dt/dy=1となる。したがって、この場合のテクスチャ20の使用率は100%である。   A square 21 indicates a state in which it is not rotated. In this case, the s-coordinate increment value ds / dx = 1 of the texture 20 and the t-coordinate increment value with respect to a change of one pixel in the x direction in the object coordinate system when focusing on the outlines 26 and 27 of the quadrangle 21. dt / dx = 0, and the s-coordinate increment value ds / dy = 0 and the t-coordinate increment value dt / dy = 1 of the object 20 with respect to a change of one pixel in the y direction in the object coordinate system. Therefore, the usage rate of the texture 20 in this case is 100%.

四角形22は、四角形21を回転させたものであり、四角形22の外郭線26、27に着目した場合のオブジェクト座標系でのx方向への1ピクセル分の変化に対するテクスチャ20のs座標増分値ds/dx=1.1、t座標増分値dt/dx=−0.1、オブジェクト座標系でのy方向への1ピクセル分の変化に対するテクスチャ20のs座標増分値ds/dy=0、t座標増分値dt/dy=1の状態を示している。この場合のテクスチャ20の使用率は約80%である。   The quadrangle 22 is obtained by rotating the quadrangle 21, and the s-coordinate increment value ds of the texture 20 with respect to a change of one pixel in the x direction in the object coordinate system when focusing on the outlines 26 and 27 of the quadrangle 22. /Dx=1.1, t-coordinate increment value dt / dx = −0.1, s-coordinate increment value ds / dy = 0 of the texture 20 with respect to a change of one pixel in the y direction in the object coordinate system, t-coordinate The state of the increment value dt / dy = 1 is shown. In this case, the usage rate of the texture 20 is about 80%.

四角形23は、四角形21を四角形22以上に回転させたものであり、四角形23の外郭線26、27に着目した場合のオブジェクト座標系でのx方向への1ピクセル分の変化に対するテクスチャ20のs座標増分値ds/dx=1.5、t座標増分値dt/dx=−0.3、オブジェクト座標系でのy方向への1ピクセル分の変化に対するオブジェクト20のs座標増分値ds/dy=0、t座標増分値dt/dy=1の状態を示している。この場合のテクスチャ20の使用率は約50%である。   The quadrangle 23 is obtained by rotating the quadrangle 21 to the quadrangle 22 or more, and the s of the texture 20 with respect to a change of one pixel in the x direction in the object coordinate system when focusing on the outlines 26 and 27 of the quadrangle 23. Coordinate increment value ds / dx = 1.5, t coordinate increment value dt / dx = −0.3, s coordinate increment value ds / dy = of object 20 with respect to change of one pixel in the y direction in the object coordinate system The state of 0, t coordinate increment value dt / dy = 1 is shown. In this case, the usage rate of the texture 20 is about 50%.

四角形24は、四角形21を四角形23以上に回転させたものであり、四角形24の外郭線26、27に着目した場合のオブジェクト座標系でのx方向への1ピクセル分の変化に対するオブジェクト20のs座標増分値ds/dx=2.2、t座標増分値dt/dx=−0.5、オブジェクト座標系でのy方向への1ピクセル分の変化に対するオブジェクト20のs座標増分値ds/dy=0、t座標増分値dt/dy=1の状態を示している。この場合のテクスチャ20の使用率は約30%である。   The quadrangle 24 is obtained by rotating the quadrangle 21 to the quadrangle 23 or more, and the s of the object 20 with respect to a change of one pixel in the x direction in the object coordinate system when focusing on the outlines 26 and 27 of the quadrangle 24. Coordinate increment value ds / dx = 2.2, t coordinate increment value dt / dx = −0.5, s coordinate increment value ds / dy = of object 20 with respect to a change of one pixel in the y direction in the object coordinate system The state of 0, t coordinate increment value dt / dy = 1 is shown. In this case, the usage rate of the texture 20 is about 30%.

四角形25は、四角形21を四角形24以上に回転させたものであり、四角形25の外郭線26、27に着目した場合のオブジェクト座標系でのx方向への1ピクセル分の変化に対するオブジェクト20のs座標増分値ds/dx=4、t座標増分値dt/dx=−0.7、オブジェクト座標系でのy方向への1ピクセル分の変化に対するオブジェクト20のs座標増分値ds/dy=0、t座標増分値dt/dy=1の状態を示している。この場合のテクスチャ20の使用率は約20%である。   The quadrangle 25 is obtained by rotating the quadrangle 21 to the quadrangle 24 or more, and the s of the object 20 with respect to a change of one pixel in the x direction in the object coordinate system when focusing on the outlines 26 and 27 of the quadrangle 25. Coordinate increment value ds / dx = 4, t coordinate increment value dt / dx = −0.7, s coordinate increment value ds / dy = 0 of object 20 with respect to a change of 1 pixel in the y direction in the object coordinate system, The state of t coordinate increment value dt / dy = 1 is shown. In this case, the usage rate of the texture 20 is about 20%.

このように、テクスチャ貼り付け図形が斜めに描画されるほど、必要とするテクスチャデータ量は少なくなるが、図3に示す従来の画像処理装置6では、キャッシュメモリ15を有効とする場合において、演算部9が演算したテクスチャ座標(s、t)のテクスチャデータがキャッシュメモリ15にない場合には、テクスチャを貼り付ける図形に使用するテクスチャデータ量が少ない場合であっても、外部メモリ5から所定の大きさのブロック単位でのテクスチャデータのキャッシュメモリ15へのキャッシングが行われることになるので、これがテクスチャ・マッピングの高速化を妨げ、描画速度の低下を招くことになる。テクスチャを貼り付ける図形が小さく描画される場合も同様である。   As described above, the more the texture pasted figure is drawn diagonally, the smaller the required texture data amount. However, in the conventional image processing apparatus 6 shown in FIG. When the texture data of the texture coordinates (s, t) calculated by the unit 9 is not in the cache memory 15, even if the amount of texture data to be used for the figure to which the texture is pasted is small, the predetermined value is read from the external memory 5. Since the texture data is cached in the cache memory 15 in units of size blocks, this hinders the speeding up of the texture mapping and causes a reduction in the drawing speed. The same applies when the figure to which the texture is pasted is drawn small.

なお、テクスチャを貼り付ける図形が斜めに描画される場合や小さく描画される場合には、あらかじめ用意しておいた小さなテクスチャを貼り付けるというミップマップ技術が知られているが、このミップマップ技術を使用する場合には、オリジナルのテクスチャを1/2、1/4、1/8などに縮小したテクスチャが必要となり、外部メモリ5に格納するテクスチャデータ量が多くなるため、外部メモリ5として、容量が大きく、価格の高いメモリを使用しなければならないという問題点が発生する。   In addition, when the figure to which the texture is pasted is drawn diagonally or is drawn small, the mipmap technology of pasting a small texture prepared in advance is known, but this mipmap technology is When used, a texture obtained by reducing the original texture to 1/2, 1/4, 1/8 or the like is required, and the amount of texture data stored in the external memory 5 increases. However, there is a problem in that a large and expensive memory must be used.

本発明は、かかる点に鑑み、テクスチャ貼り付ける図形のテクスチャデータ使用率が所定値未満と低く、外部メモリからのテクスチャデータのキャッシュメモリへのキャッシングを行うと、むしろテクスチャ・マッピングの高速化の妨げになる外部メモリからキャッシュメモリへのテクスチャデータのキャッシングを避け、描画速度の向上を図ることができるようにした画像処理装置を提供することを目的とする。   In view of this point, the present invention has a low texture data usage rate of a figure to be textured, which is less than a predetermined value. If the texture data is cached from the external memory to the cache memory, the texture mapping is not hindered. An object of the present invention is to provide an image processing apparatus capable of avoiding caching of texture data from an external memory to a cache memory and improving the drawing speed.

本発明は、外部メモリが保持するテクスチャデータの一部を保持するためにキャッシュメモリを備える画像処理装置であって、テクスチャ貼り付け図形ごとにテクスチャデータ使用率が所定値以上であるか否かを判定し、所定値以上の場合は、前記キャッシュメモリを有効とし、所定値未満の場合は、前記キャッシュメモリを無効とする制御部を備えるものである。   The present invention is an image processing apparatus including a cache memory for holding a part of texture data held by an external memory, and whether or not the texture data usage rate is a predetermined value or more for each texture pasting figure. If the determination is greater than or equal to a predetermined value, the cache memory is enabled, and if the value is less than the predetermined value, the cache memory is disabled.

前記制御部は、例えば、前記テクスチャ貼り付け図形ごとに、オブジェクト座標系での縦方向への1ピクセル分の変化及び横方向への1ピクセル分の変化に対するそれぞれの場合のテクスチャの座標増分値から、前記テクスチャデータ使用率が所定値以上であるか否かを判定するように構成される。   The control unit, for example, for each texture pasting figure, from the coordinate increment value of the texture in each case for the change of 1 pixel in the vertical direction and the change of 1 pixel in the horizontal direction in the object coordinate system The texture data usage rate is determined to be greater than or equal to a predetermined value.

本発明によれば、制御部は、テクスチャ貼り付け図形ごとにテクスチャデータ使用率が所定値以上であるか否かを判定し、所定値以上の場合は、キャッシュメモリを有効とし、所定値未満の場合は、キャッシュメモリを無効とする。この結果、外部メモリからのテクスチャデータのキャッシュメモリへのキャッシングは、テクスチャ貼り付け図形のテクスチャデータ使用率が所定値以上の場合にのみ行われ、所定値未満の場合には行われないことになる。   According to the present invention, the control unit determines whether or not the texture data usage rate is equal to or greater than a predetermined value for each texture pasting figure. In this case, the cache memory is invalidated. As a result, caching of the texture data from the external memory to the cache memory is performed only when the texture data usage rate of the texture pasted figure is equal to or greater than a predetermined value, and is not performed when it is less than the predetermined value. .

したがって、テクスチャ貼り付け図形のテクスチャデータ使用率が所定値未満と低く、外部メモリからのテクスチャデータのキャッシュメモリへのキャッシングを行うと、むしろテクスチャ・マッピングの高速化の妨げになる外部メモリからのテクスチャデータのキャッシュメモリへのキャッシングを避け、描画速度の向上を図ることができる。   Therefore, if the texture data usage rate of the texture pasted figure is low below a predetermined value and the texture data is cached from the external memory to the cache memory, the texture from the external memory is rather hindered to speed up the texture mapping. It is possible to improve the drawing speed by avoiding caching of data in the cache memory.

図1は本発明の一実施形態を外部メモリと共に示す図である。図1中、5は前述した外部メモリ、30は本発明の一実施形態であり、本発明の一実施形態30は、図3に示す従来の画像処理装置6が備える演算部7〜9、判定部10、アドレス生成部12、13、セレクタ14、キャッシュメモリ15、セレクタ16及びピクセル加工部17を設けると共に、セレクタ11を削除して、キャッシュメモリ15を有効にするか無効にするかを制御する制御部31を設けている。   FIG. 1 is a diagram showing an embodiment of the present invention together with an external memory. In FIG. 1, reference numeral 5 denotes the above-described external memory, and 30 denotes an embodiment of the present invention. The embodiment 30 of the present invention includes arithmetic units 7 to 9 included in the conventional image processing apparatus 6 shown in FIG. Unit 10, address generation units 12 and 13, selector 14, cache memory 15, selector 16, and pixel processing unit 17, and the selector 11 is deleted to control whether the cache memory 15 is enabled or disabled. A control unit 31 is provided.

制御部31には、キャッシュメモリ有効/無効境界設定信号が与えられる。このキャッシュメモリ有効/無効境界設定信号は、キャッシュメモリ15を有効にするか無効にするかを決定するための境界値として、テクスチャを貼り付ける三角形のテクスチャデータ使用率を示すものである。   The control unit 31 is given a cache memory valid / invalid boundary setting signal. The cache memory valid / invalid boundary setting signal indicates a texture data usage rate of a triangle to which a texture is pasted as a boundary value for determining whether the cache memory 15 is valid or invalid.

また、制御部31には、テクスチャを貼り付ける三角形ごとに、演算部7から、テクスチャを貼り付ける三角形の外郭線に着目した場合のオブジェクト座標系でのy方向への1ピクセル分の変化に対するテクスチャのs座標増分値ds/dy、t座標増分値dt/dyが与えられ、演算部8から、テクスチャを貼り付ける三角形の外郭線に着目した場合のオブジェクト座標系でのx方向への1ピクセル分の変化に対するテクスチャのs座標増分値ds/dx、t座標増分値dt/dxが与えられる。   In addition, the control unit 31 receives, for each triangle to which the texture is to be attached, a texture corresponding to a change of one pixel in the y direction in the object coordinate system when paying attention to the outline of the triangle to which the texture is to be attached. S-coordinate increment value ds / dy and t-coordinate increment value dt / dy are given, and one pixel in the x direction in the object coordinate system when the calculation unit 8 pays attention to the outline of the triangle to which the texture is pasted The texture s coordinate increment value ds / dx and t coordinate increment value dt / dx with respect to the change of.

また、制御部31には、判定部10がキャッシュメモリ15内に演算部9が演算したテクスチャ座標(s、t)のテクスチャデータがないと判定した場合には、判定部10から、演算部9が演算したテクスチャ座標(s、t、q)が与えられる。   If the determination unit 10 determines that the texture data of the texture coordinates (s, t) calculated by the calculation unit 9 is not present in the cache memory 15 in the control unit 31, the calculation unit 9 Is given the texture coordinates (s, t, q).

制御部31は、判定部10から演算部9が演算したテクスチャ座標(s、t、q)が与えられたときは、演算部7、8から与えられる座標増分値ds/dx、ds/dy、dt/dx、dt/dyから、テクスチャを貼り付ける三角形のテクスチャデータ使用率がキャッシュメモリ有効/無効境界設定信号が示す境界値以上であるか否かを判定し、境界値以上の場合は、キャッシュメモリ15を有効とし、アドレス生成部12に判定部10から与えられたテクスチャ座標(s、t、q)を与え、境界値未満の場合は、キャッシュメモリ15を無効とし、アドレス生成部13に判定部10から与えられたテクスチャ座標(s、t、q)を与えるように構成される。   When the texture coordinates (s, t, q) calculated by the calculation unit 9 are given from the determination unit 10, the control unit 31 receives the coordinate increment values ds / dx, ds / dy, given from the calculation units 7, 8. From dt / dx and dt / dy, it is determined whether or not the texture data usage rate of the triangle to which the texture is pasted is equal to or greater than the boundary value indicated by the cache memory valid / invalid boundary setting signal. The memory 15 is enabled, the texture coordinates (s, t, q) given from the determination unit 10 are given to the address generation unit 12, and if it is less than the boundary value, the cache memory 15 is invalidated and the address generation unit 13 determines The texture coordinates (s, t, q) given from the unit 10 are provided.

また、制御部31は、キャッシュメモリ15を有効とし、アドレス生成部12に判定部10から与えられたテクスチャ座標(s、t、q)を与える場合には、選択制御信号SCにより、アドレス生成部12が出力するアドレスを外部メモリ5に与えるようにセレクタ14を制御すると共に、キャッシュメモリ15から読み出されるテクスチャデータをピクセル加工部17に与えるようにセレクタ16を制御し、また、キャッシュメモリ15を無効とし、アドレス生成部13に判定部10から与えられたテクスチャ座標(s、t、q)を与える場合には、選択制御信号SCにより、アドレス生成部13が出力するアドレスを外部メモリ5に与えるようにセレクタ14を制御すると共に、外部メモリ5から読み出されるテクスチャデータをピクセル加工部17に与えるようにセレクタ16を制御するように構成される。   In addition, when the control unit 31 validates the cache memory 15 and gives the address coordinates to the address generation unit 12 with the texture coordinates (s, t, q) given from the determination unit 10, the control unit 31 generates the address generation unit according to the selection control signal SC. The selector 14 is controlled so as to give the address output from the external memory 5 to the external memory 5, the selector 16 is controlled so that the texture data read from the cache memory 15 is given to the pixel processing unit 17, and the cache memory 15 is invalidated. When the texture coordinates (s, t, q) given from the determination unit 10 are given to the address generation unit 13, the address output from the address generation unit 13 is given to the external memory 5 by the selection control signal SC. In addition, the selector 14 is controlled and the texture data read from the external memory 5 is pixelated. Configured to control the selector 16 to provide the processing unit 17.

このように構成された本発明の一実施形態30においては、判定部10が演算部9により演算されたテクスチャ座標(s、t)のテクスチャデータがキャッシュメモリ15にあると判定した場合には、キャッシュメモリ15から、演算部9により演算されたテクスチャ座標(s、t)のテクスチャデータが読み出されてセレクタ16を介してピクセル加工部17に与えられる。   In one embodiment 30 of the present invention configured as described above, when the determination unit 10 determines that the texture data of the texture coordinates (s, t) calculated by the calculation unit 9 is in the cache memory 15, Texture data of the texture coordinates (s, t) calculated by the calculation unit 9 is read from the cache memory 15 and given to the pixel processing unit 17 via the selector 16.

これに対して、判定部10が演算部9により演算されたテクスチャ座標(s、t)のテクスチャデータがキャッシュメモリ15にないと判定した場合には、判定部10から制御部31に、演算部9により演算されたテクスチャ座標(s、t、q)が与えられる。   On the other hand, when the determination unit 10 determines that the texture data of the texture coordinates (s, t) calculated by the calculation unit 9 is not in the cache memory 15, the determination unit 10 transfers the calculation unit to the control unit 31. The texture coordinates (s, t, q) calculated by 9 are given.

この場合、制御部31は、演算部7、8から与えられる座標増分値ds/dx、ds/dy、dt/dx、dt/dyから、テクスチャを貼り付ける三角形のテクスチャデータ使用率がキャッシュメモリ有効/無効境界設定信号が示す境界値以上であるか否かを判定する。   In this case, the control unit 31 determines that the texture data usage rate of the triangle to which the texture is pasted is valid from the coordinate increment values ds / dx, ds / dy, dt / dx, and dt / dy given from the arithmetic units 7 and 8. / It is determined whether or not the boundary value indicated by the invalid boundary setting signal is equal to or greater.

そして、制御部31は、テクスチャを貼り付ける三角形のテクスチャデータ使用率が境界値以上であると判定した場合には、キャッシュメモリ15を有効とし、アドレス生成部12に判定部10から与えられたテクスチャ座標(s、t、q)を与える。   If the control unit 31 determines that the texture data usage rate of the triangle to which the texture is to be pasted is greater than or equal to the boundary value, the control unit 31 validates the cache memory 15, and the texture given from the determination unit 10 to the address generation unit 12. The coordinates (s, t, q) are given.

この結果、アドレス生成部12は、テクスチャ座標(s、t)のテクスチャデータを含む所定の大きさのブロックのテクスチャデータを外部メモリ5から読み出すために必要なアドレスを生成して出力する。そして、これに応じて、テクスチャ座標(s、t)のテクスチャデータを含む所定の大きさのブロックのテクスチャデータが外部メモリ5から読み出されてキャッシュメモリ15にキャッシングされ、その後、テクスチャを貼り付ける三角形に使用するテクスチャデータがキャッシュメモリ15から読み出されてピクセル加工部17に与えられる。   As a result, the address generation unit 12 generates and outputs an address necessary for reading out the texture data of a block having a predetermined size including the texture data of the texture coordinates (s, t) from the external memory 5. In response to this, texture data of a block having a predetermined size including texture data of texture coordinates (s, t) is read from the external memory 5 and cached in the cache memory 15, and then the texture is pasted. Texture data used for the triangle is read from the cache memory 15 and given to the pixel processing unit 17.

これに対して、制御部31がテクスチャを貼り付ける三角形のテクスチャデータ使用率が境界値未満であると判定した場合には、制御部31は、キャッシュメモリ15を無効とし、アドレス生成部13に判定部10から与えられたテクスチャ座標(s、t、q)を与える。   On the other hand, when the control unit 31 determines that the triangle texture data usage rate to which the texture is pasted is less than the boundary value, the control unit 31 invalidates the cache memory 15 and determines to the address generation unit 13. The texture coordinates (s, t, q) given from the unit 10 are given.

この結果、アドレス生成部13は、テクスチャ座標(s、t)のテクスチャデータを外部メモリ5から読み出すために必要なアドレスを生成して出力する。そして、これに応じて、テクスチャ座標(s、t)のテクスチャデータが外部メモリ5から読み出されてピクセル加工部17に与えられる。即ち、この場合には、テクスチャを貼り付ける三角形の内部のピクセルごとのテクスチャデータが外部メモリ5からピクセル加工部17に与えられることになる。   As a result, the address generation unit 13 generates and outputs an address necessary for reading the texture data of the texture coordinates (s, t) from the external memory 5. In response to this, texture data of texture coordinates (s, t) is read from the external memory 5 and given to the pixel processing unit 17. That is, in this case, texture data for each pixel inside the triangle to which the texture is pasted is supplied from the external memory 5 to the pixel processing unit 17.

以上のように、本発明の一実施形態30によれば、テクスチャを貼り付ける三角形ごとに、テクスチャデータ使用率が境界値以上であるか否かを判定し、境界値以上の場合は、キャッシュメモリ15を有効とし、境界値未満の場合は、キャッシュメモリ15を無効とする制御部31を備えるとしているので、外部メモリ5からのテクスチャデータのキャッシュメモリ15へのキャッシングは、テクスチャを貼り付ける三角形のテクスチャデータ使用率が境界値以上の場合にのみ行われ、境界値未満の場合には行われない。   As described above, according to the embodiment 30 of the present invention, for each triangle to which a texture is pasted, it is determined whether or not the texture data usage rate is equal to or higher than the boundary value. 15 is valid, and if it is less than the boundary value, the control unit 31 invalidates the cache memory 15. Therefore, the caching of the texture data from the external memory 5 to the cache memory 15 It is performed only when the texture data usage rate is equal to or higher than the boundary value, and is not performed when it is less than the boundary value.

したがって、テクスチャを貼り付ける三角形のテクスチャデータ使用率が境界値未満と低く、外部メモリ5からのテクスチャデータのキャッシュメモリ15へのキャッシングを行うと、むしろテクスチャ・マッピングの高速化の妨げになる外部メモリ5からのテクスチャデータのキャッシュメモリ15へのキャッシングを避け、描画速度の向上を図ることができる。   Therefore, if the texture data usage rate of the triangle to which the texture is pasted is as low as less than the boundary value, and the caching of the texture data from the external memory 5 to the cache memory 15 is performed, the external memory rather hinders the speeding up of the texture mapping. Thus, caching of texture data from 5 to the cache memory 15 can be avoided, and the drawing speed can be improved.

なお、本発明の一実施形態30においては、キャッシュメモリ有効/無効境界設定信号は、キャッシュメモリ15を有効にするか無効にするかを決定するための境界値として、テクスチャを貼り付ける三角形のテクスチャデータ使用率を示すものとしたが、この代わりに、座標増分値ds/dy、ds/dx、dt/dy、dt/dxを示すものとし、制御部31は、演算部7、8から与えられる座標増分値ds/dy、ds/dx、dt/dy、dt/dxとキャッシュメモリ有効/無効境界設定信号が示す座標増分値ds/dy、ds/dx、dt/dy、dt/dxを比較してテクスチャデータ使用率を判断し、キャッシュメモリを有効とするか無効とするかを判定するように構成しても良い。   In one embodiment 30 of the present invention, the cache memory valid / invalid boundary setting signal is a triangular texture to which a texture is pasted as a boundary value for determining whether the cache memory 15 is valid or invalid. Although the data usage rate is shown, instead of this, the coordinate increment values ds / dy, ds / dx, dt / dy, dt / dx are shown, and the control unit 31 is given from the calculation units 7 and 8. Compare the coordinate increment values ds / dy, ds / dx, dt / dy, dt / dx with the coordinate increment values ds / dy, ds / dx, dt / dy, dt / dx indicated by the cache memory valid / invalid boundary setting signal. The texture data usage rate may be determined to determine whether to enable or disable the cache memory.

また、ミップマップ技術を使用し、制御部31において、演算部7、8から与えられる座標増分値ds/dy、ds/dx、dt/dy、dt/dxからミップマップレベルを算出するとしている場合には、算出したミップマップレベルの大きさにより、キャッシュメモリ15を有効とするか無効とするかを判定するようにしても良い。   When the mipmap technique is used and the control unit 31 calculates the mipmap level from the coordinate increment values ds / dy, ds / dx, dt / dy, and dt / dx given from the calculation units 7 and 8 Alternatively, it may be determined whether to enable or disable the cache memory 15 according to the calculated mipmap level.

本発明の一実施形態を外部メモリと共に示す図である。It is a figure which shows one Embodiment of this invention with an external memory. テクスチャ・マッピングの例を示す図である。It is a figure which shows the example of a texture mapping. 従来の画像処理装置の一例を外部メモリと共に示す図である。It is a figure which shows an example of the conventional image processing apparatus with an external memory. 図3に示す従来の画像処理装置が有する問題点を説明するための図である。It is a figure for demonstrating the problem which the conventional image processing apparatus shown in FIG. 3 has.

符号の説明Explanation of symbols

1…三角形
2…テクスチャ
5…外部メモリ
6…従来の画像処理装置の一例
7〜9…演算部
10…判定部
11…セレクタ
12、13…アドレス生成部
14…セレクタ
15…キャッシュメモリ
16…セレクタ
17…ピクセル加工部
20…テクスチャ
21〜25…四角形
26、27…外郭線
30…本発明の一実施形態
31…制御部

DESCRIPTION OF SYMBOLS 1 ... Triangle 2 ... Texture 5 ... External memory 6 ... Example of conventional image processing apparatus 7-9 ... Operation part 10 ... Determination part 11 ... Selector 12, 13 ... Address generation part 14 ... Selector 15 ... Cache memory 16 ... Selector 17 ... Pixel processing unit 20 ... Texture 21 to 25 ... Square 26, 27 ... Outline line 30 ... One embodiment of the present invention 31 ... Control unit

Claims (1)

外部メモリが保持するテクスチャデータの一部を保持するためにキャッシュメモリを備える画像処理装置であって、
前記キャッシュメモリ内にテクスチャを貼り付ける図形の内部の各ピクセルに対応するテクスチャ座標のテクスチャデータがない場合、前記図形に貼り付ける前記テクスチャの全データ量に対する前記図形が使用するデータ量の割合を示すテクスチャデータ使用率が所定値以上であるか否かを判定し、前記テクスチャデータ使用率が前記所定値以上の場合は、前記テクスチャ座標のテクスチャデータを含む所定の大きさのテクスチャデータを前記外部メモリから読み出して前記キャッシュメモリにキャッシングし、前記テクスチャデータ使用率が前記所定値未満の場合は、前記テクスチャ座標のテクスチャデータを前記外部メモリから読み出し、前記キャッシュメモリにキャッシングさせないように制御を行う制御部を備えること
を特徴とする画像処理装置。
An image processing apparatus including a cache memory for holding a part of texture data held by an external memory,
Indicates the ratio of the amount of data used by the graphic to the total data amount of the texture to be pasted on the graphic when there is no texture data of texture coordinates corresponding to each pixel inside the graphic to which the texture is to be pasted in the cache memory It is determined whether a texture data usage rate is equal to or greater than a predetermined value. If the texture data usage rate is equal to or greater than the predetermined value , texture data having a predetermined size including texture data of the texture coordinates is stored in the external memory. A control unit that reads from the cache memory and caches the texture data, and when the texture data usage rate is less than the predetermined value, reads the texture data of the texture coordinates from the external memory and performs control so that the cache memory is not cached It is characterized by having Image processing apparatus.
JP2006235272A 2006-08-31 2006-08-31 Image processing device Expired - Fee Related JP4784446B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006235272A JP4784446B2 (en) 2006-08-31 2006-08-31 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006235272A JP4784446B2 (en) 2006-08-31 2006-08-31 Image processing device

Publications (2)

Publication Number Publication Date
JP2008059266A JP2008059266A (en) 2008-03-13
JP4784446B2 true JP4784446B2 (en) 2011-10-05

Family

ID=39241930

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006235272A Expired - Fee Related JP4784446B2 (en) 2006-08-31 2006-08-31 Image processing device

Country Status (1)

Country Link
JP (1) JP4784446B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103034465B (en) * 2011-09-29 2016-04-27 腾讯科技(深圳)有限公司 Image browsing method and browing system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3623972B2 (en) * 1993-06-04 2005-02-23 株式会社東芝 Graphic drawing processor
JPH09282135A (en) * 1996-04-11 1997-10-31 Hitachi Ltd Plotting data fetching method and graphic processor
JP3770422B2 (en) * 1996-06-27 2006-04-26 ソニー株式会社 Image generating apparatus and method, and data compression method
JP3514947B2 (en) * 1997-06-05 2004-04-05 シャープ株式会社 Three-dimensional image processing apparatus and three-dimensional image processing method
JP2003196674A (en) * 2001-12-25 2003-07-11 Mega Chips Corp Image processing method, image processing device and storage medium readable by computer

Also Published As

Publication number Publication date
JP2008059266A (en) 2008-03-13

Similar Documents

Publication Publication Date Title
KR100703709B1 (en) Apparatus and method for processing graphics, and computer readable medium storing the same
KR100300972B1 (en) Texture mapping system and texture cache access method
US8823724B2 (en) Sparse texture systems and methods
US20140075060A1 (en) Gpu memory buffer pre-fetch and pre-back signaling to avoid page-fault
KR102554419B1 (en) A method and an apparatus for performing tile-based rendering using prefetched graphics data
US20090128575A1 (en) Systems and Methods for Managing Texture Descriptors in a Shared Texture Engine
JP3645024B2 (en) Drawing apparatus and drawing method
US7898551B2 (en) Systems and methods for performing a bank swizzle operation to reduce bank collisions
JP2008176788A (en) Three-dimensional graphics accelerator and its pixel distributing method
US9905036B2 (en) Graphics processing unit for adjusting level-of-detail, method of operating the same, and devices including the same
KR20200035446A (en) Texture resident check using compressed metadata
US20150228111A1 (en) Graphics processing unit
KR20150018953A (en) Graphics processing unit, method thereof, and devices having the same
US8860743B2 (en) Sparse texture systems and methods
US20110157207A1 (en) Sparse texture systems and methods
KR20230127291A (en) Optional creation of missing requests for cache lines
TWI395152B (en) A graphics processing unit and a method of processing border color information
JP4784446B2 (en) Image processing device
KR20100068603A (en) Apparatus and method for generating mipmap
KR100420402B1 (en) Graphics drawing device of processing drawing data including rotation target object and non-rotation target object
US10956338B2 (en) Low latency dirty RAM for cache invalidation speed improvement
US20220050781A1 (en) Command processor prefetch techniques
KR20230035326A (en) Optionally rewrite dirty cache lines upon processing
US6590579B1 (en) System for low miss rate replacement of texture cache lines
EP2738736B1 (en) Image drawing apparatus with a cache memory

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20080730

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090427

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110322

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110520

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110614

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110627

R150 Certificate of patent or registration of utility model

Ref document number: 4784446

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140722

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees