JP2008299642A - Pattern drawing device - Google Patents
Pattern drawing device Download PDFInfo
- Publication number
- JP2008299642A JP2008299642A JP2007145650A JP2007145650A JP2008299642A JP 2008299642 A JP2008299642 A JP 2008299642A JP 2007145650 A JP2007145650 A JP 2007145650A JP 2007145650 A JP2007145650 A JP 2007145650A JP 2008299642 A JP2008299642 A JP 2008299642A
- Authority
- JP
- Japan
- Prior art keywords
- graphics
- processing
- buffer
- vector graphics
- processor
- 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.)
- Pending
Links
Images
Abstract
Description
この発明は、数式で定義されたベクター図形を描画する分野において、ベクターグラフィックス描画と3Dグラフィックス描画を同時に実現させる図形描画装置に関するものである。 The present invention relates to a graphics drawing apparatus that simultaneously realizes vector graphics drawing and 3D graphics drawing in the field of drawing vector graphics defined by mathematical expressions.
ベクターグラフィックスは、入力データがベジエ曲線などの数式で与えられその輪郭線を微小な線分に分割して多角形描画が行われる。そのためビットマップ画像のように拡大縮小してもジャギーが発生することなく高品質な図形描画ができるという特徴がある。そして2Dベクターグラフィックス処理用のプログラミングインタフェースとしてOpenVGが使用されてきている。このOpenVGは、規格標準化団体であるKhronos Groupにより仕様策定されたグラフィックスAPIで、曲線などで定義されたパスやストロークの塗りつぶし処理、マトリクス変換処理、クリッピングやマスク処理、イメージを貼り付けるパターンペイント処理、アンチエイリアス処理、ブレンド処理、ディザ処理などの様々な機能が定義されている。一般にベクターグラフィックスでは数式で定義された輪郭曲線を多角形へ変換または分割して描画を行うために、専用ハードウェアやソフトウェアで実装されることが多い(例えば、特許文献1参照)。 In vector graphics, input data is given by a mathematical expression such as a Bezier curve, and the outline is divided into minute line segments to draw a polygon. Therefore, there is a feature that high-quality graphic drawing can be performed without generating jaggy even if the image is enlarged or reduced like a bitmap image. OpenVG has been used as a programming interface for 2D vector graphics processing. This OpenVG is a graphics API specified by the Khronos Group, which is a standards organization, and is designed to fill paths and strokes defined by curves, matrix conversion processing, clipping and mask processing, and pattern paint processing to paste images Various functions such as anti-aliasing, blending, and dithering are defined. In general, vector graphics are often implemented by dedicated hardware or software in order to perform drawing by converting or dividing a contour curve defined by a mathematical expression into a polygon (see, for example, Patent Document 1).
ベクターグラフィックスでは数式で定義された輪郭曲線などがピクセルに分解される。そして分解されたピクセルはアンチエイリアス処理された後、マスク情報などを元にフレームバッファへ書き込まれる。一方、3Dグラフィックスではポリゴンで定義されたデータが座標変換された後ピクセルへ分解される。ピクセルはデプスバッファなどを使用して前後判定を行いながらピクセルの書き込みが行われる。このように、ベクターグラフィックスと3Dグラフィックスでは処理内容が異なるために、ハードウェアで実装する場合は異なるハードウェアになってしまう。 In vector graphics, contour curves defined by mathematical formulas are decomposed into pixels. The decomposed pixels are anti-aliased and then written into the frame buffer based on mask information and the like. On the other hand, in 3D graphics, data defined by polygons is coordinate-transformed and then decomposed into pixels. Pixels are written while performing a forward / backward determination using a depth buffer or the like. As described above, since the processing contents are different between vector graphics and 3D graphics, when hardware is used, the hardware becomes different.
ベクターグラフィックス、3Dグラフィックス共にそれぞれをハードウェア実装したときのハードウェア規模は一般に大きい。そのため、ベクターグラフィックスと3Dグラフィックスの両方をハードウェアで実装すると非常に大きなゲート規模となってしまう。これは特に組み込み向け用途などで、ハードウェア規模を小さく抑える必要がある分野では大きな問題となり、ゲート規模増加により消費電力も増加してしまうといった問題があった。 The hardware scale is generally large when both vector graphics and 3D graphics are implemented by hardware. Therefore, when both vector graphics and 3D graphics are implemented by hardware, the gate scale becomes very large. This is a big problem especially in the field of embedded use, where it is necessary to keep the hardware scale small, and there is a problem that power consumption increases due to an increase in the gate scale.
この発明は上記のような課題を解決するためになされたもので、ベクターグラフィックスと3Dグラフィックスのハードウェアを共用することにより、少ないハードウェア規模で効率よく図形描画処理を実行することのできる図形描画装置を得ることを目的とする。 The present invention has been made to solve the above-described problems. By sharing the hardware of vector graphics and 3D graphics, it is possible to efficiently execute graphic drawing processing with a small hardware scale. An object is to obtain a graphic drawing apparatus.
この発明に係る図形描画装置は、3Dグラフィックスのジオメトリ処理とベクターグラフィックスのエッジ交点算出処理を行うプロセッサと、エッジ交点算出処理結果であるスキャンライン情報からピクセルへの展開を行うスキャンライン展開部と、3Dグラフィックス及びベクターグラフィックスにおけるピクセルシェーダ処理を行うピクセルシェーダと、3Dグラフィックスではデプスバッファとして用い、ベクターグラフィックスではマスクバッファとして用いる第1の補助バッファと、3Dグラフィックスではステンシルバッファとして用い、ベクターグラフィックスではシザーバッファとして用いる第2の補助バッファと、3Dグラフィックス及びベクターグラフィックスで共通に用いるカラーバッファと、第1の補助バッファ、第2の補助バッファ及びカラーバッファを用い、ピクセルシェーダから出力されたデータに対して、3Dグラフィックス及びベクターグラフィックスにおけるフラグメント処理を行うフラグメント処理部とを備えたものである。 A graphic drawing apparatus according to the present invention includes a processor that performs 3D graphics geometry processing and vector graphics edge intersection calculation processing, and a scan line expansion unit that expands pixels from scan line information that is the result of edge intersection calculation processing A pixel shader that performs pixel shader processing in 3D graphics and vector graphics, a first auxiliary buffer that is used as a depth buffer in 3D graphics, a mask buffer in vector graphics, and a stencil buffer in 3D graphics A second auxiliary buffer used as a scissor buffer in vector graphics, a color buffer commonly used in 3D graphics and vector graphics, and a first auxiliary buffer, Using two auxiliary buffer and color buffer, the data outputted from the pixel shader, in which a fragment processing unit that performs fragmentation process in 3D graphics and vector graphics.
この発明の図形描画装置は、プロセッサとその入出力バッファをベクターグラフィックスと3Dグラフィックスで共用し、更に描画関連バッファをベクターグラフィックスと3Dグラフィックスで別の用途で使用するようにしたので、少ないハードウェア規模で効率よく図形描画処理を実行することができる。 In the graphic drawing apparatus of the present invention, the processor and its input / output buffer are shared by vector graphics and 3D graphics, and the drawing related buffer is used for different purposes by vector graphics and 3D graphics. The graphic drawing process can be executed efficiently with a small hardware scale.
実施の形態1.
図1は、この発明の実施の形態1による図形描画装置を示す構成図である。
図において、図形描画装置は、SP入力バッファ100、SIMDプロセッサ101、SPプログラムメモリ102、VG(Vector Graphics)シーケンス制御部103、SP出力バッファ104〜107、VGスキャンライン展開部108、3Dセットアップ109、3Dラスタライザ110、テクスチャフェッチ部111、ピクセルシェーダ112、ピクセルシェーダプログラムメモリ113、フラグメント処理部114、カラーバッファ115、第1の補助バッファ116、第2の補助バッファ117を備えている。
FIG. 1 is a block diagram showing a figure drawing apparatus according to
In the figure, a graphics drawing apparatus includes an SP input buffer 100, a
SP入力バッファ100は、SIMDプロセッサ101への入力データを保持するためのバッファであり、ベクターグラフィックスを処理する場合にはVG輪郭情報100aが、また、3Dグラフィックスを処理する場合には物体を構成するモデルデータや光の情報といった3Dモデルデータ100bが予め格納される。SIMDプロセッサ101は、4−SIMDを構成するプロセッサであり、PU0、PU1、PU2、PU3の演算コアから構成される。SPプログラムメモリ102は、SIMDプロセッサ101が実行するプログラムを格納するためのメモリであり、ベクターグラフィックス処理用としてVG輪郭情報から輪郭座標を算出すためのプログラムや、OpenVGのマトリクス処理を行うプログラムといったVG用プログラム102aが格納される。また、SPプログラムメモリ102には、3Dグラフィックス処理用として、幾何学演算処理やライティング処理を行うためのプログラム(頂点シェーダプログラム相当)といった3D用プログラム102bが格納される。尚、SIMDプロセッサ101は、3Dグラフィックスで一般に使用される頂点シェーダのような演算プロセッサであっても構わない。
The SP input buffer 100 is a buffer for holding input data to the
VGシーケンス制御部103は、SIMDプロセッサ101を制御してベクターグラフィックス処理を行うためのプログラマブルロジックコントローラである。SP出力バッファ104〜107は、SIMDプロセッサ101におけるそれぞれの演算コアで演算された結果を一時保存するためのバッファであり、それぞれベクターグラフィックス用のVGエッジデータ104a〜107a、3D頂点データ104b〜107bが格納されるようになっている。VGスキャンライン展開部108は、ベクターグラフィックス処理に用いられる機能部であり、SP出力バッファ104〜107にある輪郭線のエッジリストを読み出して、スキャンライン情報からピクセルへ展開するよう構成されている。3Dセットアップ109は、SP出力バッファ104〜107にある3D頂点データ104b〜107bから、ビューポート変換、クリップ処理、そしてラスタライズに必要な増分パラメータの計算を行う機能部である。3Dラスタライザ110は、3Dセットアップ109から出力された増分パラメータからポリゴンの中に含まれるピクセル値を算出する機能部である。テクスチャフェッチ部111は、VGスキャンライン展開部108及び3Dラスタライザ110から出力されたテクスチャ座標に基づいて、テクセルデータを求め、これをピクセルシェーダ112に出力する機能部である。
The VG
ピクセルシェーダ112は、ピクセル演算処理を行うための4−SIMDプロセッサであり、ピクセルシェーダプログラムメモリ113に格納されたプログラムにより実行されるものである。ピクセルシェーダプログラムメモリ113は、ベクターグラフィックス処理と3Dグラフィックス処理ではそれぞれ異なるピクセルシェーダプログラム(VG用プログラム113a,3D用プログラム113b)が格納されている。
The
フラグメント処理部114は、ベクターグラフィックス処理を行う場合は、ピクセルのブレンディング処理とアルファブレンディング処理を行うと共に、シザークリップ処理を行う機能を有している。また、フラグメント処理部114は、3Dグラフィックス処理を行う場合は、デプステストとステンシルテストを行い、ピクセル値をカラーバッファ115に書き込む処理を行う。カラーバッファ115は、ピクセル毎の色情報を格納するためのバッファである。第1の補助バッファ116は、ベクターグラフィックス処理のためのVGマスクアルファ116aと3Dグラフィックス処理のための3Dデプス情報116bを格納し、第2の補助バッファ117は、ベクターグラフィックス処理のためのVGシザー情報117aと3Dグラフィックス処理のための3Dステンシル情報117bを格納するバッファである。
The
次に、実施の形態1の図形描画装置による実施の形態1を説明する。
描画処理に先立ち、SP入力バッファ100にはベクターグラフィックスを処理する場合にはVG輪郭情報100aが、3Dグラフィックスを処理する場合には3Dモデルデータ100bが予め格納されているものとする。
SIMDプロセッサ101は、SPプログラムメモリ102からプログラムを読み出しながら実行する。ベクターグラフィックス処理の場合、曲線などの輪郭情報は微小な線分(エッジ)に分割され、そのエッジの両端の座標をv0(x0,y0)、v1(x1,y1)、スキャンラインのY座標をyとすると、スキャンラインとエッジの交点座標xs(y)は以下の式で求めることができる。但し、y0=y1のときは交点座標の算出は行わない。
Prior to the rendering process, it is assumed that the SP input buffer 100 stores
The
また、曲線を微小な線分に分解せずに、直接2次のベジエ曲線からスキャンラインとの交点座標を以下のように算出することもできる。ベジエ曲線はパラメータt(0≦t≦1)を用いて以下のパラメトリック形式で定義される。
x(t)=(1−t)2*x0+2*(1−t)*t*x1+t2*x2 (1)
y(t)=(1−t)2*y0+2*(1−t)*t*y1+t2*y2 (2)
In addition, the intersection coordinates with the scan line can be calculated directly from a secondary Bezier curve as follows without decomposing the curve into minute line segments. A Bezier curve is defined in the following parametric format using a parameter t (0 ≦ t ≦ 1).
x (t) = (1-t) 2 * x0 + 2 * (1-t) * t * x1 + t 2 * x2 (1)
y (t) = (1-t) 2 * y0 + 2 * (1-t) * t * y1 + t 2 * y2 (2)
(1),(2)式をtについて整理して方程式を解くと、
a=y0−2*y1+y2(定数)
b=2*(y1−y0) (定数)
c=y0−y
When the equations are solved by arranging (1) and (2) with respect to t,
a = y0-2 * y1 + y2 (constant)
b = 2 * (y1-y0) (constant)
c = y0-y
このように、スキャンラインのY座標yが一意に決まれば、(3)式によりパラメータtの値が求まり(判別式b2−4*a*c≧0の場合)、それを(1)式に代入すれば、ベジエ曲線とスキャンラインとの交点座標xを算出することができる。尚、これらの交点算出やその他のOpenVG用マトリクス処理などは、通常、プログラムを記述することにより実行されるが、高速化とプログラム領域を削減するためにSIMDプロセッサの演算器とレジスタを直接VGシーケンス制御部103によって制御することにより、プログラムを介さずにハードワイヤードにより処理しても構わない。
In this way, if the Y coordinate y of the scan line is uniquely determined, the value of the parameter t is obtained by the equation (3) (when discriminant b 2 −4 * a * c ≧ 0), and is expressed by the equation (1). Can be calculated, the intersection point coordinate x between the Bezier curve and the scan line can be calculated. These intersection calculation and other OpenVG matrix processing are usually performed by writing a program, but in order to increase the speed and reduce the program area, the SIMD processor's arithmetic units and registers are directly connected to the VG sequence. By controlling by the
SIMDプロセッサ101は、SPプログラムメモリ102におけるVG用プログラム102aまたは3D用プログラム102bを実行後、演算結果をSP出力バッファ104〜107へ出力する。ベクターグラフィックス処理の場合には輪郭線とスキャンラインの交点座標xのリスト(4個分)が並列に書き込まれる。3Dグラフィックス処理の場合には、幾何学演算処理された以下のようなポリゴンの頂点データが書き込まれる。各データは4成分から構成されるので、各成分がSP出力バッファ104〜107へ並列に書き込まれる。
The
Position (x,y,z,w)
Front Color (r,g,b,a)
Back Color (r,g,b,a)
Fog (−,−,−,f)
Texture(n) (s,t,r,q)
Position (x, y, z, w)
Front Color (r, g, b, a)
Back Color (r, g, b, a)
Fog (-,-,-, f)
Texture (n) (s, t, r, q)
VGスキャンライン展開部108は、SP出力バッファ104〜107にある輪郭線のエッジリストを読み出して、スキャンライン情報からピクセルへ展開する。即ち、描画すべきピクセルのx,y座標とアンチエイリアスのためのカバレッジ情報を算出する。
3Dセットアップ109は、SP出力バッファ104〜107にある頂点データからビューポート変換、クリップ処理、そしてラスタライズに必要な増分パラメータの計算を行う。増分パラメータとしてはラスタライズに必要なエッジファンクションのパラメータや各属性の平面の方程式の係数A,B,Cなどがある。
The VG scan
The 3D setup 109 calculates incremental parameters necessary for viewport conversion, clip processing, and rasterization from the vertex data in the SP output buffers 104-107. Incremental parameters include edge function parameters required for rasterization and coefficients A, B, and C of plane equations for each attribute.
3Dラスタライザ110は、3Dセットアップ109から出力された増分パラメータからポリゴンの中に含まれるピクセル値を算出する。一般的には、ポリゴンの中に含まれるピクセルを特定するためにエッジファンクションなどを利用してx,y座標を求める。次に各属性の平面の方程式の係数A,B,Cを用いてカラーやフォグの値を計算する。テクスチャ座標のようにパースペクティブコレクションを施すためには除算処理も必要となる。
テクスチャフェッチ部111は、VGスキャンライン展開部108、3Dラスタライザ110から出力されたテクスチャ座標をアドレスとしてテクスチャメモリ(図示せず)をアクセスし、テクセルデータを読み出す。読み出されたテクセルデータはバイリニア、トライリニアなどのフィルタ処理が施された後、ピクセルシェーダ112へ出力される。
ピクセルシェーダ112は、ベクターグラフィックス処理か、3Dグラフィックス処理かに応じて、ピクセルシェーダプログラムメモリ113のVG用プログラム113aか3D用プログラム113bを用いてそれぞれの処理に対応したピクセル演算処理を行う。ピクセルシェーダ112における各種の演算処理は、VGスキャンライン展開部108、3Dラスタライザ110から出力されるピクセル情報(カラー、フォグ、テクスチャ座標)と、テクスチャフェッチ部111から出力されるテクセルデータを使用して行われる。
The texture fetch
The
フラグメント処理部114は、ベクターグラフィックス処理を行う場合、カラーバッファ115からデスティネーションカラーを読み出して、ピクセルのブレンディング処理を行う。その後、カバレッジと第1の補助バッファ116から読み出されたマスクアルファ値(VGマスクアルファ116a)を乗算し、アンチエイリアスのためのアルファブレンディング処理を行う。マスクアルファ(Masking)はOpenVGで定義されている機能である。この機能はマスクアルファ値をテクスチャメモリに格納して、マルチテクスチャとして処理することによっても等価な処理を行うことが可能である。またフラグメント処理部114は、第2の補助バッファ117からシザー情報(VGシザー情報117a)を読み出すことにより、シザークリップ処理も行う。シザー情報はピクセル当たり1bitのデータで描画すべき矩形エリアが予め設定されているものとする。このシザークリップもOpenVGで定義された機能である。そして描画すべきピクセルであれば、最終カラー値がカラーバッファ115へ書き込まれる。
When performing the vector graphics processing, the
一方、フラグメント処理部114が3Dグラフィックス処理を行う場合、第1の補助バッファ116からデプス情報(3Dデプス情報116b)を読み出してデプステストを行うと共に、第2の補助バッファ117からはステンシル情報(3Dステンシル情報117b)を読み出してステンシルテストを行う。そして、両方のテストにパスしたら、ピクセル値をカラーバッファ115へ書き込むと同時に第1の補助バッファ116及び第2の補助バッファ117のデプス情報とステンシル情報の更新を行う。これらの機能はOpenGLで定義された機能である。
On the other hand, when the
このように、SIMDプロセッサとその入出力バッファをベクターグラフィックスと3Dグラフィックスで共用し、更に描画関連バッファをベクターグラフィックスと3Dグラフィックスで別の用途で使用することにより、ラスタライザを除くほとんどのハードウェアを共通で使用することが可能となる。そして無駄なハードウェアを実装することなくハードウェア規模を削減でき、アイドル状態になる演算器も少なくなるので消費電力を低減できる。 In this way, the SIMD processor and its input / output buffer are shared by vector graphics and 3D graphics, and the drawing-related buffer is used for different purposes in vector graphics and 3D graphics, so that most of the exceptions of the rasterizer are used. It becomes possible to use hardware in common. In addition, the hardware scale can be reduced without installing unnecessary hardware, and the number of computing units that are in an idle state is reduced, so that power consumption can be reduced.
以上のように、実施の形態1の図形描画装置によれば、3Dグラフィックスのジオメトリ処理とベクターグラフィックスのエッジ交点算出処理を行うプロセッサと、エッジ交点算出処理結果であるスキャンライン情報からピクセルへの展開を行うスキャンライン展開部と、3Dグラフィックス及びベクターグラフィックスにおけるピクセルシェーダ処理を行うピクセルシェーダと、3Dグラフィックスではデプスバッファとして用い、ベクターグラフィックスではマスクバッファとして用いる第1の補助バッファと、3Dグラフィックスではステンシルバッファとして用い、ベクターグラフィックスではシザーバッファとして用いる第2の補助バッファと、3Dグラフィックス及びベクターグラフィックスで共通に用いるカラーバッファと、第1の補助バッファ、第2の補助バッファ及びカラーバッファを用い、ピクセルシェーダから出力されたデータに対して、3Dグラフィックス及びベクターグラフィックスにおけるフラグメント処理を行うフラグメント処理部とを備えたので、少ないハードウェア規模で効率よく図形描画処理を実行することができる。 As described above, according to the graphics drawing apparatus of the first embodiment, a processor that performs 3D graphics geometry processing and vector graphics edge intersection calculation processing, and scan line information that is the result of edge intersection calculation processing are converted into pixels. A scan line developing unit for developing the image, a pixel shader for performing pixel shader processing in 3D graphics and vector graphics, a first auxiliary buffer used as a depth buffer in 3D graphics, and as a mask buffer in vector graphics, A second auxiliary buffer used as a stencil buffer in 3D graphics, a scissor buffer in vector graphics, and a color buffer commonly used in 3D graphics and vector graphics; Since a single auxiliary buffer, a second auxiliary buffer, and a color buffer are used and a fragment processing unit that performs fragment processing in 3D graphics and vector graphics on data output from the pixel shader is provided, less hardware is required. The graphic drawing process can be executed efficiently on a wear scale.
また、実施の形態1の図形描画装置によれば、プロセッサに入力する3Dグラフィックスのジオメトリ処理を行うための入力データとベクターグラフィックスのエッジ交点算出処理に行うための入力データのいずれか一方を保持する入力バッファと、プロセッサから出力された3Dグラフィックスとベクターグラフィックスのいずれかの処理結果の出力データを保持する出力バッファとを備えると共に、プロセッサは、実行するベクターグラフィックスと3Dグラフィックスの処理に応じて対応するプログラムを実行するようにしたので、更にハードウェア規模を削減することができ、より消費電力を低減することができる。 In addition, according to the graphic drawing apparatus of the first embodiment, either input data for performing geometry processing of 3D graphics input to the processor or input data for performing edge intersection calculation processing of vector graphics is input. An input buffer for holding, and an output buffer for holding output data of a processing result of either 3D graphics or vector graphics output from the processor, and the processor includes vector graphics and 3D graphics to be executed. Since the corresponding program is executed according to the processing, the hardware scale can be further reduced, and the power consumption can be further reduced.
実施の形態2.
図2は図1におけるSIMDプロセッサ101のベクターグラフィックスでの動作をより具体的に説明するためのものである。
ベクターグラフィックスでは、アンチエイリアスのカバレッジを算出するために、1個のスキャンラインを複数のサブスキャンラインに分割して処理を行う。図2では4個のサブスキャンラインy0,y1,y2,y3に分割している。SIMDプロセッサ101は4−SIMD構成であるので、演算コアPU0,PU1,PU2,PU3にサブスキャンラインy0,y1,y2,y3を割り当てて並列に処理を行う。そして、PU0,PU1,PU2,PU3は、自身に割り当てられたサブスキャンラインと全輪郭線とのX座標交点を順次求め、SP出力バッファ104,105,106,107へ書き込んでいく。図2の例においては、PU0はエッジ0の交点x00、エッジ1の交点x01、エッジ2の交点x02、エッジ3の交点x03を算出し、各エッジのUP/DOWN情報と共にSP出力バッファ104へ書き込んでいく。同様に、PU1,PU2,PU3も各交点X座標とUP/DOWN情報をSP出力バッファ105,106,107へ書き込む。
Embodiment 2. FIG.
FIG. 2 is a diagram for specifically explaining the operation of the
In vector graphics, in order to calculate anti-aliasing coverage, one scan line is divided into a plurality of sub-scan lines. In FIG. 2, it is divided into four sub scan lines y0, y1, y2 and y3. Since the
次に、VGスキャンライン展開部108は、このSP出力バッファ104,105,106,107に書き込まれた情報を読み出して輪郭線で囲まれた領域のピクセルのカバレッジ(アンチエイリアス処理を行うためのピクセル占有率)を求め、ピクセルを生成していく。このカバレッジを求めるためにVGスキャンライン展開部108はマスク情報生成用スキャンラインカウンタ(図示せず)を備え、これを用いて処理を行う。スキャンラインカウンタは、1スキャンライン分のカウンタ群で構成され、ピクセル毎にエッジとの交差回数をカウントする。カウンタはスキャンラインと交差するエッジのUP/DOWN情報に基づいてインクリメント/デクリメントした合計値である。このスキャンラインカウンタを用いることにより、複雑な図形でもX座標のソーティングをすることなく高速なピクセル生成が可能である。
Next, the VG scan
このように、SIMDプロセッサの各演算コアがサブスキャンラインの交点X座標とUP/DOWN情報算出を並列に行うことにより、ベクターグラフィックスのピクセル生成に必要なデータ作成を効率よく実行できる。 As described above, the calculation cores of the SIMD processor perform the calculation of the intersection X coordinate of the sub-scan line and the UP / DOWN information in parallel, thereby efficiently generating data necessary for vector graphics pixel generation.
以上のように、実施の形態2の図形描画装置によれば、ベクターグラフィックスのエッジ交点算出処理をアンチエイリアス処理に用い、プロセッサは複数のサブスキャンラインのエッジ交点を並列に算出するようにしたので、アンチエイリアス処理におけるピクセル生成に必要なデータ作成を効率よく実行することができる。 As described above, according to the graphic drawing apparatus of the second embodiment, vector graphics edge intersection calculation processing is used for antialiasing processing, and the processor calculates edge intersections of a plurality of sub-scan lines in parallel. Therefore, it is possible to efficiently execute data creation necessary for pixel generation in the anti-aliasing process.
実施の形態3.
図3は、図2におけるSIMDプロセッサの動作をフローチャートとして示した図である。
描画すべきオブジェクト(1パス分)のY座標の最小値をYmin、Y座標の最大値をYmaxとする。先ず、ステップST301でカレントスキャンラインYをYminに設定し、サブスキャンラインy0,y1,y2,y3の値を設定する(y0=Y,y1=Y+0.25,y2=Y+0.5,y3=Y+0.75)。次に、ステップST302でSP入力バッファ100から輪郭データ(エッジ)を読み出し、ステップST303でそのエッジとサブスキャンラインy0,y1,y2,y3の交点X座標の計算を、PU0,PU1,PU2,PU3を用いて並列に行う。算出した交点X座標はステップST304において、PU0はSP出力バッファ104へ、PU1はSP出力バッファ105へ、PU2はSP出力バッファ106へ、PU3はSP出力バッファ107へ同時に書き込む。
Embodiment 3 FIG.
FIG. 3 is a flowchart showing the operation of the SIMD processor in FIG.
The minimum value of the Y coordinate of the object to be drawn (for one pass) is Ymin, and the maximum value of the Y coordinate is Ymax. First, in step ST301, the current scan line Y is set to Ymin, and the values of the sub scan lines y0, y1, y2, and y3 are set (y0 = Y, y1 = Y + 0.25, y2 = Y + 0.5, y3 = Y + 0). .75). Next, in step ST302, contour data (edge) is read from the SP input buffer 100, and in step ST303, the intersection X coordinate of the edge and the sub-scan lines y0, y1, y2, y3 is calculated as PU0, PU1, PU2, PU3. In parallel. In step ST304, the calculated intersection X coordinate is simultaneously written into the
次に、ステップST305で1個のオブジェクトから線分に分割された全てのエッジ(またはベジエで定義された曲線)を処理したかの判定を行い、まだ処理されていないエッジが残っていれば、ステップST302に戻り、サブスキャンラインy0,y1,y2,y3とその処理されていないエッジとの交点X座標の算出を繰り返す。そして、ステップST305の判定で全エッジの処理が完了したら、ステップST306においてVGスキャンライン展開部108の起動を行う。この起動によりVGスキャンライン展開部108は1スキャンライン分のピクセル生成を行う。ピクセル生成が終了したら、ステップST307においてカレントスキャンラインを1進め、サブピクセルスキャンラインy0,y1,y2,y3の更新も行う。ステップST308でカレントスキャンラインYがYmaxを超えたかを比較し、超えていれば処理を終了する。超えていなければ、ステップST310においてSP入力バッファ100のリードポインタをリセットし、サブスキャンラインy0,y1,y2,y3と全エッジの交点X座標の算出を同様にして行う。
Next, in step ST305, it is determined whether all edges (or curves defined by Beziers) divided into line segments from one object have been processed, and if there are still unprocessed edges, Returning to step ST302, the calculation of the intersection X coordinate between the sub-scan lines y0, y1, y2, and y3 and the unprocessed edge is repeated. When the processing of all edges is completed in the determination in step ST305, the VG scan
以上のように、実施の形態3の図形描画装置では、1スキャンライン毎に全エッジと交差するサブスキャンラインの交点X座標の算出と、スキャンラインのピクセル生成を交互に行うことにより、ベクターグラフィックスの塗りつぶし処理を行うことができる。尚、説明を簡単にするために、交点X座標の算出とスキャンラインのピクセル生成を順番に行うこととしたが、パイプライン処理によりこれら2つの処理は並列に実行することも可能である。但し、パイプライン処理を行うためにはSP出力バッファをダブルバッファ構成などにする必要がある。 As described above, in the graphic drawing apparatus according to the third embodiment, the vector graphic is obtained by alternately calculating the intersection X coordinate of the sub-scan line that intersects all edges for each scan line and generating the pixel of the scan line. Can be filled. In order to simplify the description, the calculation of the intersection X coordinate and the pixel generation of the scan line are sequentially performed. However, these two processes can be executed in parallel by pipeline processing. However, in order to perform pipeline processing, the SP output buffer needs to have a double buffer configuration or the like.
実施の形態4.
図4は図2におけるSIMDプロセッサの動作をフローチャートとして示した図である。
描画すべきオブジェクト(1パス分)のY座標の最小値をYmin、Y座標の最大値をYmaxとする。先ず、ステップST401でカレントスキャンラインYをYminに設定し、サブスキャンラインy0,y1,y2,y3の値を設定する(y0=Y,y1=Y+0.25,y2=Y+0.5,y3=Y+0.75)。次に、ステップST402でSP入力バッファ100から輪郭データ(エッジ)を読み出し、ステップST403でそのエッジとサブスキャンラインy0,y1,y2,y3の交点X座標の計算をPU0,PU1,PU2,PU3を用いて並列に行う。算出した交点X座標はステップST404において、PU0はSP出力バッファ104へ、PU1はSP出力バッファ105へ、PU2はSP出力バッファ106へ、PU3はSP出力バッファ107へ同時に書き込む。このとき実施の形態3の場合とは異なり、カレントスキャンラインだけではなく次のスキャンラインの交点X座標も順次書き込みを行うので、Y座標とのペアでエッジリストを作成する。つまり、SP出力バッファには1オブジェクトと交差する全エッジの交点X座標が格納されるので、実施の形態3よりも大きな領域が必要となる。
Embodiment 4 FIG.
FIG. 4 is a flowchart showing the operation of the SIMD processor in FIG.
The minimum value of the Y coordinate of the object to be drawn (for one pass) is Ymin, and the maximum value of the Y coordinate is Ymax. First, in step ST401, the current scan line Y is set to Ymin, and the values of the sub scan lines y0, y1, y2, and y3 are set (y0 = Y, y1 = Y + 0.25, y2 = Y + 0.5, y3 = Y + 0). .75). Next, in step ST402, contour data (edge) is read from the SP input buffer 100. In step ST403, the intersection X coordinate of the edge and the sub scan lines y0, y1, y2, y3 is calculated as PU0, PU1, PU2, PU3. Use in parallel. In step ST404, the calculated intersection X coordinate is simultaneously written into the
次に、ステップST405で1個のオブジェクトから線分に分割された全てのエッジ(またはベジエで定義された曲線)を処理したかの判定を行い、まだ処理されていないエッジが残っていれば、ステップST402に戻り、サブスキャンラインy0,y1,y2,y3とその処理されていないエッジとの交点X座標の算出を繰り返す。そして、ステップST405の判定で全エッジの処理が完了したら、ステップST406においてカレントスキャンラインを1進め、サブピクセルスキャンラインy0,y1,y2,y3の更新を行う。ステップST407でカレントスキャンラインYがYmaxを超えたかを比較し、超えていれば、1個のオブジェクトと交差する全てのサブスキャンラインの交点算出が終了したことになるので、ステップST408においてVGスキャンライン展開部108の起動を行う。VGスキャンライン展開部108は、実施の形態3の場合とは異なり、SP出力バッファ104〜107に格納されている1個のオブジェクトと交差する全てのサブスキャンラインの交点X座標を読み出して、ピクセルを生成していく。
Next, in step ST405, it is determined whether all edges (or curves defined by Bezier) divided from one object into line segments have been processed, and if there are still unprocessed edges, Returning to step ST402, the calculation of the intersection X coordinate between the sub-scan lines y0, y1, y2, and y3 and the unprocessed edge is repeated. When all edge processing is completed in the determination in step ST405, the current scan line is advanced by 1 in step ST406, and the sub-pixel scan lines y0, y1, y2, and y3 are updated. In step ST407, it is compared whether or not the current scan line Y exceeds Ymax. If it exceeds, the intersection calculation of all the sub-scan lines intersecting with one object is completed, so in step ST408 the VG scan line is determined. The
ステップST407において、カレントスキャンラインYがYmaxを超えていなければ、ステップST410においてSP入力バッファ100のリードポインタをリセットし、ステップST402に戻り、サブスキャンラインと全エッジの交点X座標の算出を同様にして行う。 If the current scan line Y does not exceed Ymax in step ST407, the read pointer of the SP input buffer 100 is reset in step ST410, and the process returns to step ST402 to calculate the intersection X coordinate of the sub scan line and all edges in the same manner. Do it.
以上のように、実施の形態4の図形描画装置によれば、1個のオブジェクトと交差する全サブスキャンラインエッジの交点X座標の算出と、ピクセル生成を行うことにより、ベクターグラフィックスの塗りつぶし処理を高速に行うことができる。 As described above, according to the graphic drawing apparatus of the fourth embodiment, the calculation of the intersection X coordinate of all the sub-scan line edges intersecting with one object and the pixel generation are performed, thereby performing vector graphics filling processing. Can be performed at high speed.
実施の形態5.
図5は、図1におけるSIMDプロセッサ101が2並列の場合(SIMDプロセッサ101aとSIMDプロセッサ101bで構成)のベクターグラフィックスでの動作をより具体的に説明するためのものである。
ベクターグラフィックスではアンチエイリアスのカバレッジを算出するために、1個のスキャンラインを複数のサブスキャンラインに分割して処理を行う。図5では8個のサブスキャンラインy0,y1,y2,y3,y4,y5,y6,y7に分割したものである。
SIMDプロセッサは一般に4−SIMD構成であるので、SIMDプロセッサ101aの演算コアPU0,PU1,PU2,PU3に、サブスキャンラインy0,y1,y2,y3を割り当てて並列に処理を行う。そして、もう一方のSIMDプロセッサ101bの演算コアPU0,PU1,PU2,PU3に、サブスキャンラインy4,y5,y6,y7を割り当てる。各演算コアは自身に割り当てられたサブスキャンラインと全輪郭線とのX座標交点を順次求め、SP出力バッファ104〜107へ書き込んでいく。図5の例においては、SIMDプロセッサ101aのPU0はエッジ0の交点x00、エッジ1の交点x01、エッジ2の交点x02、エッジ3の交点x03を算出し、各エッジのUP/DOWN情報と共にSP出力バッファ104へ書き込んでいく。同様にPU1,PU2,PU3、そしてSIMDプロセッサ101bのPU0,PU1,PU2,PU3も各交点X座標とUP/DOWN情報をSP出力バッファへ書き込む。
Embodiment 5 FIG.
FIG. 5 is a diagram for more specifically explaining the operation in vector graphics when the
In vector graphics, processing is performed by dividing one scan line into a plurality of sub-scan lines in order to calculate anti-aliasing coverage. In FIG. 5, the sub-scan lines are divided into eight sub-scan lines y0, y1, y2, y3, y4, y5, y6, and y7.
Since the SIMD processor generally has a 4-SIMD configuration, sub-scan lines y0, y1, y2, and y3 are assigned to the arithmetic cores PU0, PU1, PU2, and PU3 of the
次に、VGスキャンライン展開部108は、SP出力バッファ104〜107に書き込まれた情報を元に、輪郭線で囲まれた領域のピクセルのカバレッジを求めピクセルを生成していく。カバレッジを求めるために図示しないマスク情報生成用スキャンラインカウンタを用いる。スキャンラインカウンタは、1スキャンライン分のカウンタ群でピクセル毎にエッジとの交差回数をカウントする。カウンタはスキャンラインと交差するエッジのUP/DOWN情報に基づいてインクリメント/デクリメントした合計値である。このスキャンラインカウンタを用いることにより、複雑な図形でもX座標のソーティングをすることなく高速なピクセル生成が可能である。
Next, the VG scan
このように、複数のSIMDプロセッサを用いてサブスキャンラインの交点X座標とUP/DOWN情報算出を並列に行うことにより、ベクターグラフィックスのピクセル生成に必要なデータ作成を効率よく実行できる。 In this way, by using a plurality of SIMD processors to calculate the intersection X coordinate of the sub-scan line and the UP / DOWN information in parallel, it is possible to efficiently create data necessary for generating the vector graphics pixel.
尚、上記実施の形態では、複数のSIMDプロセッサを用いて複数のスキャンラインの処理に割り当てるよう構成したが、SIMDプロセッサ101のSIMD数を増やすことにより複数のスキャンラインを同時に並列処理するよう構成してもよい。
In the above-described embodiment, a plurality of SIMD processors are used to allocate a plurality of scan lines. However, by increasing the number of SIMDs in the
以上のように、実施の形態5の図形描画装置によれば、プロセッサをSIMDプロセッサとしてSIMDプロセッサを複数用意し、これら複数のSIMDプロセッサで複数のサブスキャンラインのエッジ交点算出処理を並列に処理するようにしたので、カバレッジの算出精度を向上させ、アンチエイリアスの品質を向上させることができる。 As described above, according to the graphic drawing apparatus of the fifth embodiment, a plurality of SIMD processors are prepared using SIMD processors as processors, and edge intersection calculation processing of a plurality of sub-scan lines is performed in parallel by the plurality of SIMD processors. As a result, coverage calculation accuracy can be improved and anti-aliasing quality can be improved.
また、実施の形態5の図形描画装置によれば、プロセッサをSIMDプロセッサとして、SIMDプロセッサのSIMD数を増加させることによりエッジ交点算出処理を並列に行うサブスキャンラインの数を増加させるようにしたので、カバレッジの算出精度を向上させ、アンチエイリアスの品質を向上させることができる。 Further, according to the graphic drawing apparatus of the fifth embodiment, since the processor is an SIMD processor, the number of SIMDs of the SIMD processor is increased to increase the number of sub-scan lines that perform edge intersection calculation processing in parallel. , Improve coverage calculation accuracy and improve anti-aliasing quality.
100 SP入力バッファ、100a VG輪郭情報、100b 3Dモデルデータ、101,101a,101b SIMDプロセッサ、102 SPプログラムメモリ、102a,113a VG用プログラム、102b,113b 3D用プログラム、103 VGシーケンス制御部、104〜107 SP出力バッファ、104a〜107a VGエッジデータ、104b〜107b 3D頂点データ、108 VGスキャンライン展開部、109 3Dセットアップ、110 3Dラスタライザ、111 テクスチャフェッチ部、112 ピクセルシェーダ、113 ピクセルシェーダプログラムメモリ、114 フラグメント処理部、115 カラーバッファ、116 第1の補助バッファ、116a VGマスクアルファ、116b 3Dデプス情報、117 第2の補助バッファ、117a VGシザー情報、117b 3Dステンシル情報。 100 SP input buffer, 100a VG contour information, 100b 3D model data, 101, 101a, 101b SIMD processor, 102 SP program memory, 102a, 113a VG program, 102b, 113b 3D program, 103 VG sequence controller, 104- 107 SP output buffer, 104a to 107a VG edge data, 104b to 107b 3D vertex data, 108 VG scanline development unit, 109 3D setup, 110 3D rasterizer, 111 texture fetch unit, 112 pixel shader, 113 pixel shader program memory, 114 Fragment processing unit, 115 color buffer, 116 first auxiliary buffer, 116a VG mask alpha, 116b 3D data Scan information, 117 a second auxiliary buffer, 117a VG scissor information, 117b 3D stencil information.
Claims (5)
前記エッジ交点算出処理結果であるスキャンライン情報からピクセルへの展開を行うスキャンライン展開部と、
3Dグラフィックス及びベクターグラフィックスにおけるピクセルシェーダ処理を行うピクセルシェーダと、
3Dグラフィックスではデプスバッファとして用い、ベクターグラフィックスではマスクバッファとして用いる第1の補助バッファと、
3Dグラフィックスではステンシルバッファとして用い、ベクターグラフィックスではシザーバッファとして用いる第2の補助バッファと、
3Dグラフィックス及びベクターグラフィックスで共通に用いるカラーバッファと、
前記第1の補助バッファ、前記第2の補助バッファ及び前記カラーバッファを用い、前記ピクセルシェーダから出力されたデータに対して、3Dグラフィックス及びベクターグラフィックスにおけるフラグメント処理を行うフラグメント処理部とを備えた図形描画装置。 A processor for performing 3D graphics geometry processing and vector graphics edge intersection calculation processing;
A scan line development unit that develops the pixel from the scan line information that is the result of the edge intersection calculation process;
A pixel shader that performs pixel shader processing in 3D graphics and vector graphics;
A first auxiliary buffer used as a depth buffer in 3D graphics and as a mask buffer in vector graphics;
A second auxiliary buffer used as a stencil buffer in 3D graphics and a scissor buffer in vector graphics;
A color buffer commonly used in 3D graphics and vector graphics;
A fragment processing unit that performs fragment processing in 3D graphics and vector graphics on the data output from the pixel shader using the first auxiliary buffer, the second auxiliary buffer, and the color buffer; Figure drawing device.
前記プロセッサは、実行するベクターグラフィックスと3Dグラフィックスの処理に応じて対応するプログラムを実行することを特徴とする請求項1記載の図形描画装置。 An input buffer for holding either input data for performing geometry processing of 3D graphics input to the processor or input data for performing edge intersection calculation processing of vector graphics, and 3D graphics output from the processor And an output buffer for holding output data of the processing result of either one of the vector graphics and
2. The graphic drawing apparatus according to claim 1, wherein the processor executes a corresponding program in accordance with vector graphics processing and 3D graphics processing to be executed.
これら複数のSIMDプロセッサで複数のサブスキャンラインのエッジ交点算出処理を並列に処理することを特徴とする請求項3記載の図形描画装置。 Prepare multiple SIMD processors as SIMD processors,
4. The graphic drawing apparatus according to claim 3, wherein the plurality of SIMD processors process edge intersection calculation processing for a plurality of sub-scan lines in parallel.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007145650A JP2008299642A (en) | 2007-05-31 | 2007-05-31 | Pattern drawing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007145650A JP2008299642A (en) | 2007-05-31 | 2007-05-31 | Pattern drawing device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008299642A true JP2008299642A (en) | 2008-12-11 |
Family
ID=40173102
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007145650A Pending JP2008299642A (en) | 2007-05-31 | 2007-05-31 | Pattern drawing device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008299642A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101036242B1 (en) * | 2009-06-05 | 2011-05-20 | 계명대학교 산학협력단 | Image rendering method for vector graphic and apparatus thereof |
JP2013532855A (en) * | 2010-07-13 | 2013-08-19 | アドバンスト・マイクロ・ディバイシズ・インコーポレイテッド | Dynamic enabling and disabling of SIMD units in graphics processors |
US9311102B2 (en) | 2010-07-13 | 2016-04-12 | Advanced Micro Devices, Inc. | Dynamic control of SIMDs |
JP2016520920A (en) * | 2013-04-30 | 2016-07-14 | マイクロソフト テクノロジー ライセンシング,エルエルシー | 2D curve tessellation using graphics pipeline |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07152637A (en) * | 1993-09-20 | 1995-06-16 | Internatl Business Mach Corp <Ibm> | System and method for storage |
JPH1145346A (en) * | 1997-07-29 | 1999-02-16 | Matsushita Electric Ind Co Ltd | Plotting device/method for three-dimensional picture and medium recording plotting method |
WO2007049610A1 (en) * | 2005-10-25 | 2007-05-03 | Mitsubishi Electric Corporation | Image processor |
-
2007
- 2007-05-31 JP JP2007145650A patent/JP2008299642A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07152637A (en) * | 1993-09-20 | 1995-06-16 | Internatl Business Mach Corp <Ibm> | System and method for storage |
JPH1145346A (en) * | 1997-07-29 | 1999-02-16 | Matsushita Electric Ind Co Ltd | Plotting device/method for three-dimensional picture and medium recording plotting method |
WO2007049610A1 (en) * | 2005-10-25 | 2007-05-03 | Mitsubishi Electric Corporation | Image processor |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101036242B1 (en) * | 2009-06-05 | 2011-05-20 | 계명대학교 산학협력단 | Image rendering method for vector graphic and apparatus thereof |
JP2013532855A (en) * | 2010-07-13 | 2013-08-19 | アドバンスト・マイクロ・ディバイシズ・インコーポレイテッド | Dynamic enabling and disabling of SIMD units in graphics processors |
US9311102B2 (en) | 2010-07-13 | 2016-04-12 | Advanced Micro Devices, Inc. | Dynamic control of SIMDs |
JP2016520920A (en) * | 2013-04-30 | 2016-07-14 | マイクロソフト テクノロジー ライセンシング,エルエルシー | 2D curve tessellation using graphics pipeline |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8730253B2 (en) | Decomposing cubic Bezier segments for tessellation-free stencil filling | |
EP3039652B1 (en) | Prefixed summed length in graphics processing | |
JP5232358B2 (en) | Rendering outline fonts | |
US9177351B2 (en) | Multi-primitive graphics rendering pipeline | |
US8379025B1 (en) | Methods and apparatus for rendering vector art on graphics hardware | |
US9183651B2 (en) | Target independent rasterization | |
JP4937359B2 (en) | Graphic drawing apparatus and graphic drawing method | |
US7928984B1 (en) | Efficient data packaging for rendering bézier curves on a GPU | |
US8068106B1 (en) | Rendering cubic Bézier curves as quadratic curves using a GPU | |
US20170270710A1 (en) | Fast, Coverage-Optimized, Resolution-Independent and Anti-aliased Graphics Processing | |
US10192348B2 (en) | Method and apparatus for processing texture | |
JP2008299642A (en) | Pattern drawing device | |
EP4168976A1 (en) | Fine grained replay control in binning hardware |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100301 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20111003 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20111018 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20120228 |