JP3655723B2 - Coordinate transformation processing circuit for performing coordinate transformation and clipping determination - Google Patents

Coordinate transformation processing circuit for performing coordinate transformation and clipping determination Download PDF

Info

Publication number
JP3655723B2
JP3655723B2 JP01935597A JP1935597A JP3655723B2 JP 3655723 B2 JP3655723 B2 JP 3655723B2 JP 01935597 A JP01935597 A JP 01935597A JP 1935597 A JP1935597 A JP 1935597A JP 3655723 B2 JP3655723 B2 JP 3655723B2
Authority
JP
Japan
Prior art keywords
coordinate
output
clipping
vector
register
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
JP01935597A
Other languages
Japanese (ja)
Other versions
JPH09270017A (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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP01935597A priority Critical patent/JP3655723B2/en
Publication of JPH09270017A publication Critical patent/JPH09270017A/en
Application granted granted Critical
Publication of JP3655723B2 publication Critical patent/JP3655723B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、グラフィックス描画処理などに利用する座標変換を実行する浮動小数点プロセッサユニットの座標変換処理回路に関する。
【0002】
【従来の技術】
グラフィックス描画処理では、ポリゴンの頂点座標を3次元座標から表示装置用の2次元座標に変換する。この座標変換は(4×4)行列と4要素のベクトルの積を計算することによって求められる。座標変換後の2次元座標は表示領域の範囲内に入っているか否かをチェックするクリッピング判定を行う必要がある。
【0003】
上記グラフィックス描画処理において、

Figure 0003655723
とすると、
【数1】
Figure 0003655723
となるので、4個の積和演算器を並列に4回繰り返せば座標変換を高速に実行することができる。この座標変換が終わった後、変換された座標が表示領域の範囲内にあるかどうかのクリッピングチェックを行なう。
【0004】
実際には座標変換後の1点(x´, y´, z´, w´)について考えると、
【数2】
−|w´|<x´<|w´| …(1式)
−|w´|<y´<|w´| …(2式)
−|w´|<z´<|w´| …(3式)
上式全てが成立する場合に領域内となる。これを点のクリッピング判定と呼ぶことにする。
【0005】
領域外の場合には以下の条件でどの方向に出ているかをチェックできる。
【0006】
【数3】
|x´|<−|w´|:x負方向の領域外 …(4式)
|x´|> |w´|:x正方向の領域外 …(5式)
|y´|<−|w´|:y負方向の領域外 …(6式)
|y´|> |w´|:y正方向の領域外 …(7式)
|z´|<−|w´|:z負方向の領域外 …(8式)
|z´|> |w´|:z正方向の領域外 …(9式)
ポリゴン(n角形)を描画する場合にはn頂点分の点クリッピング判定を行なう。その結果、全て領域内だった場合、そのポリゴンが領域内だと判定でき、そのまま表示する。一つでも頂点が領域外だと、そのポリゴンをクリップして表示する。また、そのポリゴンの全ての頂点が領域外の時は二通りの場合がある。全ての頂点が一定方向の領域外なら、例えば全ての頂点が(4式)を満たすならば、そのポリゴンを表示しない。それ以外、例えば頂点1が(4式)を満たし、それ以外は(5式)を満たす場合などは、そのポリゴンをクリップして表示する。
【0007】
このような座標変換、クリッピング判定を行なう浮動小数点プロセッサの一例を図5に示す。
【0008】
図5に示す浮動小数点プロセッサはコプロセッサとして設計されており、命令のフェッチ、デコードなどはメインプロセッサ側で行なわれる。条件分岐はコプロセッサ側からTRUE/FALSE信号がメインプロセッサ側に送られ、その信号によってメインプロセッサ側で条件分岐が行なわれる。
【0009】
この浮動小数点プロセッサは、128ビットのソースバス1及びソースバス2と、同じく128ビットのディスティネーションバス3を有し、図6に示すようなレジスタ4ならびに図7に示すような演算器7x,7y,7z,7wを有している。それぞれの128ビットバスは32ビットづつ4グループに分けられる。これをx系統、y系統、z系統、w系統と呼ぶことにする。
【0010】
ソースバス2とディスティネーションバス3では、x系統のバスはレジスタ4のレジスタ番号が4で割り切れるレジスタ(R0,R4,R8,…)に接続され、y系統のバスはレジスタ番号が4で割ると1余るレジスタ(R1,R5,R9,…)に接続され、z系統のバスはレジスタ番号が4で割ると2余るレジスタ(R2,R6,R10,…)に接続され、w系統のバスはレジスタ番号が4で割ると3余るレジスタ(R3,R7,R11,…)に接続されている。ソースバス1は全てのバスが全てのレジスタに接続されてクロスバー構成になっている。
【0011】
演算器7x,7y,7z,7wはそれぞれ積和演算器(FMACx,FMACy,FMACz,FMACw)を構成し、積和演算、乗算、加算、減算を4並列で実行することができる。比較演算などの特殊な演算は演算器7wが行なう。
【0012】
図5に示すように接続することによって、座標変換における(4×4)行列の計算を高速に行なうことができる。以下に、行列計算で用いる命令とプログラム例を示す。
【0013】
記述:R数値はレジスタ番号数値のレジスタを示す。
【0014】
FMUL命令
4個の乗算を並列に行なう。
【0015】
Figure 0003655723
FMAC命令4個の乗算を並列に行なう。
【0016】
Figure 0003655723
浮動小数点数の符号を反転する。
【0017】
Figure 0003655723
浮動小数点数の比較を行なう。比較結果はTRUE/FALSE信号を用いてプロセッサ側に送られる。
【0018】
例:
FCMP eq R0,R1
R0とR1が等しければTRUE信号を送る。そうでなければFALSE信号を送る。
【0019】
FCMP ne R0,R1
R0とR1が等しくなればTRUE信号を送る。そうでなければFALSE信号を送る。
【0020】
FCMP gt R0,R1
R0がR1より大きければTRUE信号を送る。そうでなければFALSE信号を送る。
【0021】
FCMP le R0,R1
R0がR1以下ならばTRUE信号を送る。そうでなければFALSE信号を送る。
【0022】
FCMP lt R0,R1
R0がR1より小さければTRUE信号を送る。そうでなければFALSE信号を送る。
【0023】
FCMP eq R0,R1
R0がR1以上ならばTRUE信号を送る。そうでなければFALSE信号を送る。
【0024】
BCT命令
コプロセッサからTRUE信号が送られて来たらLABELに分岐する。
【0025】
例:
BCT label
これらの命令を使って、三角形がポリゴンの座標変換とクリッピング判定を行なうプログラムを記述すると以下のようになる。
【0026】
〜各データとレジスタの対応〜
変換前の三角形ポリゴンの頂点1:(R0,R1,R2,R3)
変換前の三角形ポリゴンの頂点2:(R4,R5,R6,R7)
変換前の三角形ポリゴンの頂点3:(R8,R9,R10,R11)
Figure 0003655723
変換後の三角形ポリゴンの頂点1:(R32,R33,R34,R35)
変換後の三角形ポリゴンの頂点2:(R36,R37,R38,R39)
変換後の三角形ポリゴンの頂点3:(R40,R41,R42,R43)
………ここからプログラムリスト……list 1………
;頂点1の座標変換
FMUL R32−R35,R0,R16−R19
FMAC R32−R35,R1,R20−R23
FMAC R32−R35,R2,R24−R27
FMAC R32−R35,R3,R28−R31
;頂点2の座標変換
FMUL R36−R39,R4,R16−R19
FMAC R36−R39,R5,R20−R23
FMAC R36−R39,R6,R24−R27
FMAC R36−R39,R7,R28−R31
;頂点3の座標変換
FMUL R40−R43,R8,R16−R19
FMAC R40−R43,R9,R20−R23
FMAC R40−R43,R10,R24−R27
FMAC R40−R43,R11,R28−R31
;クリッピング判定(wは正と仮定)
;頂点1
FCMP gt R32,R35 ;頂点1:x>wなら…
BCT label ;クリッピング処理へジャンプ
FCMP gt R33,R35 ;頂点1:y>wなら…
BCT label ;クリッピング処理へジャンプ
FCMP gt R34,R35 ;頂点1:z>wなら…
BCT label ;クリッピング処理へジャンプ
FNEG gt R35,R35 ;R35=−(R35)
FCMP lt R32,R35 ;頂点1:x<−wなら…
BCT label ;クリッピング処理へジャンプ
FCMP lt R33,R35 ;頂点1:y<−wなら…
BCT label ;クリッピング処理へジャンプ
FCMP lt R34,R35 ;頂点1:z<−wなら…
BCT label ;クリッピング処理へジャンプ
;頂点2
FCMP gt R36,R39 ;頂点2:x>wなら…
BCT label ;クリッピング処理へジャンプ
FCMP gt R37,R39 ;頂点2:y>wなら…
BCT label ;クリッピング処理へジャンプ
FCMP gt R38,R39 ;頂点2:z>wなら…
BCT label ;クリッピング処理へジャンプ
FNEG R39,R39 ;R39=−(R39)
FCMP lt R36,R39 ;頂点2:x<−wなら…
BCT label ;クリッピング処理へジャンプ
FCMP lt R37,R39 ;頂点2:y<−wなら…
BCT label ;クリッピング処理へジャンプ
FCMP lt R38,R39 ;頂点2:z<−wなら…
BCT label ;クリッピング処理へジャンプ
;頂点3
FCMP gt R40,R43 ;頂点3:x>wなら…
BCT label ;クリッピング処理へジャンプ
FCMP gt R41,R43 ;頂点3:y>wなら…
BCT label ;クリッピング処理へジャンプ
FCMP gt R42,R43 ;頂点3:z>wなら…
BCT label ;クリッピング処理へジャンプ
FNEG R43,R43 ;R43=−(R43)
FCMP lt R40,R43 ;頂点3:x<−wなら…
BCT label ;クリッピング処理へジャンプ
FCMP lt R41,R43 ;頂点3:y<−wなら…
BCT label ;クリッピング処理へジャンプ
FCMP lt R42,R43 ;頂点3:z<−wなら…
BCT label ;クリッピング処理へジャンプ
………ここまでプログラムリスト……list 1………
【0027】
【発明が解決しようとする課題】
以上説明したように、グラフィックス描画処理における座標変換を行う従来のプロセッサにおいては、二つの数値の比較命令と条件分岐命令を組み合わせるため、クリッピング判定のための比較と条件分岐に多くの命令を必要としていた。このため、クリッピング判定を伴う座標変換性能が低下してしまうという不具合を招いていた。
【0028】
そこでこの発明は、上記に鑑みてなされたものであり、その目的とするところは、グラフィックス描画処理における座標変換後のクリッピング判定を効率良く行なう座標変換処理回路を提供することにある。
【0029】
【課題を解決するための手段】
上記目的を達成するために、本発明は、入力座標ベクトル(x、y、z、1)の透視変換を行い、その変換結果として出力座標ベクトル(x´、y´、z´、w´)の各要素を出力する4つの座標変換回路と、出力座標ベクトル(x´、y´、z´)を出力する座標変換回路の夫々について設けられ、当該出力座標ベクトル(x´、y´、z´)の夫々の座標値を出力座標ベクトル(w´)の値と比較することによって、夫々の座標についてその表示領域内に収まっている否か判定する3つの比較回路と、前記比較回路からの出力を格納するクリッピングレジスタとを備え、出力座標ベクトル(w´)を出力する座標変換回路は、変換結果である該出力座標ベクトル(w´)を、出力座標ベクトル(x´、y´、z´)を出力する座標変換回路に入力させることを特徴とする。
【0030】
上記発明において、前記出力座標ベクトルの値は、夫々符号と絶対値を示すフィールドで表され、前記比較回路は、絶対値を示すフィールド同士を比較する比較器と、前記比較器からの出力と前記出力座標ベクトル(x´、y´、z´)の各々の座標値の論理積を出力する第1の回路と、前記比較器からの出力の反転信号と前記出力座標ベクトル(x´、y´、z´)の各々の座標値の論理積を出力する第2の回路とから構成することができる。
【0031】
上記発明において、前記クリッピングレジスタはシフトレジスタであり、前記比較回路からの出力をシフト動作によって退避しておくことができる。
【0032】
上記発明において、前記クリッピングレジスタは、複数の座標ベクトルに対応するシフトレジスタに格納された前記判別結果に基く論理信号を出力する論理回路を有することが好ましい。
【0033】
上記発明において、前記論理回路は、論理和ゲートであることが好ましい。
【0034】
上記発明において、前記比較回路は、x´>|w´|又はx´<−|w´|の場合にx´が表示領域外であることを示す信号を出力し、y´>|w´|又はy´<−|w´|の場合にy´が表示領域外であることを示す信号を出力し、z´>|w´|又はz´<−|w´|の場合にz´が表示領域外であることを示す信号を出力することが好ましい。
【0035】
上記発明において、前記比較回路の夫々は、前記出力座標ベクトル(x´、y´、z´)の夫々の座標値が、夫々の座標について表示領域内に収まっている場合と、その表示領域の正の方向に外れている場合と、その表示領域の負の方向に外れている場合とのいずれであるかを示す2ビットの識別信号を出力することが好ましい。
また、上記発明において、前記クリッピングレジスタは、6xnビット(n>1)のシフトレジスタであり、6ビット分のレジスタ部分が前記比較回路の識別信号を受け、6ビットのシフト動作によって順次他の部分に退避しておくことが好ましい。
さらに、上記発明において、前記クリッピングレジスタは、少なくとも18ビットのシフトレジスタであり、この18ビットの論理積を出力する出力回路が接続されていることが好ましい。
また、前記3つの比較器による判定を、並列に行うことが好ましい。
さらに、前記出力座標ベクトル(x´、y´、z´、w´)は、グラフィックス描画処理におけるポリゴンの頂点座標であることが好ましい。
【0036】
【発明の実施の形態】
以下、図面を用いてこの発明の実施の形態を説明する。
【0037】
図1に、本発明の1実施例による座標変換処理回路を用いたグラフィックス処理システムを示す。
【0038】
このシステムでは、プロセッサ1と、グラフィックスプロセッサユニット(以下、「GPU」と記す。)3と、メインメモリ5がメインバス7でそれぞれ接続されており、さらに、グラフィックスメモリ9がGPU3にグラフィックスバス11で接続されている。
【0039】
GPU3は前処理部13とメイン処理部15を有しており、メイン処理部15はDDAを使い、グラフィックスメモリ9から読み取ったテクスチャ情報を使って、出力画像のピクセルをレンダリングし、結果をグラフィックスメモリ9上のフレームバッファに書き込む。また、前処理部13はメイン処理のDDAの初期値、差分値などのパラメータを計算する。
【0040】
プロセッサ1はプロセッサコア17によりメインメモリ5からプログラムを読み込んで実行する。プロセッサコア17はプログラムに従って、画面に描画すべきポリゴンの頂点の2次元座標と色情報等(以下、「GPUコマンド情報」と記す。)を作る。その際、座標変換ユニット19を使用して3次元座標から2次元座標を作る。さらに、プロセッサ1はプログラムに従って、上記GPUコマンド情報に付加情報(どんなポリゴンを描画するかの識別コマンド)を付け加え、GPUコマンドとしてメインバス7を通してGPU3に送り、GPU3が描画を実行する。なお、メインバス7を使わずに専用のバスを利用して情報を送る場合も考えられ得る。また、プロセッサ1のGPUコマンドを作るスピードと、GPU3の描画スピードがバランスしない場合(どちらかが遅い等)には、メインメモリ5上にGPUコマンドをバッファリングして速度差を吸収する。
【0041】
図2に座標変換処理回路19の構成を示す。この実施形態の座標変換処理回路は、図5に示す座標変換処理回路に比べて、図5に示す演算器7x,7y,7zと同等の機能に加えて図3に示すクリッピング用比較器4x、4y、4zを内蔵した演算器5x,5y,5zと、図4に示すクリッピングレジスタ6を備えて構成されており、他の構成は図5と同様である。
【0042】
図3において、クリッピング比較器4x、4y、4zは、座標変換後の頂点n(n=1、2、3)の浮動小数点による出力座標ベクトル(xn ,yn ,zn ,wn )を受けて、xn とwn を比較してxn >|wn |又はxn <−|wn |あるいはxn ≧|wn |又はxn ≦−|wn |を判別し、yn とwn を比較してyn >|wn |又はyn <−|wn |あるいはyn ≧|wn |又はyn ≦−|wn |を判別し、zn とwn を比較してzn >|wn |又はzn <−|wn |あるいはzn ≧|wn |又はzn ≦−|wn |を判別し、それぞれの判別結果を出力する動作を1つの比較命令により行い、座標変換後の頂点nの出力座標ベクトル(xn ,yn ,zn ,wn )を符号を含めて保持する入力レジスタ51、52と、入力レジスタ51に保持された出力座標ベクトル(xn ,yn ,zn )と入力レジスタ52に保持された出力座標ベクトルwn の大小関係をそれぞれ比較する比較器53と、比較器53の比較結果と入力レジスタ51に保持された出力座標ベクトルの符号の反転値を入力してxn >wn 又はyn >wn 又はzn >wn あるいはxn ≧wn 又はyn ≧wn 又はzn ≧wn を判別する論理積(AND)ゲート54と、比較器53の比較結果と入力レジスタ51に保持された出力座標ベクトルの符号を入力してxn <−wn 又はyn <−wn 又はzn <−wn あるいはxn ≦−wn 又はyn ≦−wn 又はzn ≦−wn を判別するANDゲート55を備えて構成されている。
【0043】
図4において、クリッピングレジスタ6は、シフトレジスタ61と論理和(OR)ゲート62を備えている。論理和(OR)ゲート62は、シフトレジスタ61の右側の18ビットのビット積を出力する。
【0044】
前記比較命令の実行により、シフトレジスタ61は、演算器5x,5y,5zのクリッピング比較器から出力されたそれぞれの判別結果を受ける為に、6ビット分左シフトを行う。つまり、一連の処理の中で、頂点(n−1)の前出力座標ベクトル(xn-1 ,yn-1 ,zn-1 ,wn-1 )の判別結果をシフトした後、次のクリッピング判別結果を空いた右側の6ビットに受け取る。そして、判別結果がn頂点分(ここでは3頂点分)揃った段階で、シフトインされて保持されたn角形(三角形)ポリゴンの頂点の判別結果からクリッピング比較器による判別が成立する頂点が存在するか否かのクリッピング判定が、シフトレジスタ61で行われ、クリッピングすべき頂点が存在する場合にはクリッピング処理を実行する分岐命令を実行させる信号を出力する。
【0045】
図3に示すクリッピング比較器において、入力レジスタ51の入力は、演算器5xならx値が、演算器5yならy値が、演算器5zならz値が入力される。入力レジスタ52の入力はどの演算器5x,5y,5zでも同一のw値が入力される。
【0046】
入力xを代表して説明すると、入力xの符号ビットと、入力wの符号ビットを分離し、数値フィールドのみを比較器53に入力する。ここでは、入力x,y,zの数値フィールドを入力1とし、入力wの数値フィールドを入力2とする。ここで数値フィールドは、浮動小数点の指数部と仮数部からなっている。
【0047】
比較器53の比較結果は、入力1>入力2の場合に「1」、そうでない場合には「0」となる。比較の条件は入力1≧入力2でも構わない。さらに、入力x,y,zの符号ビットの反転値をANDゲート54の一方の入力とし、入力x,y,zの符号ビットをANDゲート55の一方の入力とする。
【0048】
図4に示す構成において、比較器53は入力xと入力wの絶対値を比較し、|x|>|w|でx≧0(つまり、x>w)の時、ANDゲート54の出力である+Clipping Info.が「1」になり、|x|>|w|でx<0(つまり、x<−w)の時、ANDゲート55の出力である−Clipping Info.が「1」になる(wは正であると仮定する)。
【0049】
次に、演算器5x,5y,5z,5wのそれぞれのクリッピング用比較器からの出力、+x Clipping Info.、+y Clipping Info.、+z Clipping Info.、−x Clipping Info.、−y Clipping Info.、−z Clipping Info.、をクリッピングレジスタ6への入力とする。
【0050】
クリッピング用比較器は、FCLIP命令で演算器5x,5y,5zのクリッピング用比較器が同時に実行される。FCLIP命令は、6ビット左シフト後、クリッピング比較を行ない、クリッピング判定を行なう。詳しくは以下の通りである。
【0051】
FCLIP命令動作例
FCLIP R0−R3,R4
(1) 第一動作
シフトレジスタ61を6ビット左シフト。
【0052】
(2) 第二動作
R0(入力x)とR4(入力w)を演算器5xのクリッピング比較器で比較する。R1(入力y)とR4(入力w)を演算器5yのクリッピング比較器で比較する。R2(入力z)とR4(入力w)を演算器5zのクリッピング比較器で比較する。
【0053】
(3) 第三動作
クリッピング判定
シフトレジスタ61の下位18ビットに一つでも「1」があれば、メインプロセッサにTRUE信号を送る。
【0054】
尚、上記第一動作と第二動作は、独立なので平行して行われる。
【0055】
クリッピングレジスタ6を構成するシフトレジスタ61は、図5に示すように、例えば32ビットのレジスタで、最下位6ビットがクリッピング比較器の出力に接続されている。第0ビットが+Clipping Info.に、第1ビットが+Clipping Info.に、第2ビットが+Clipping Info.に、第3ビットが+Clipping Info.に、第4ビットが+Clipping Info.に、第5ビットが+Clipping Info.に、それぞれ接続されている。
【0056】
シフトレジスタ61は、FCLIP命令が実行される度に6ビット左シフトされるので、常に最新の頂点のクリッピング情報が第0〜5ビットに、一つ前の頂点のクリッピング情報が第6〜11ビットに、二つ前の頂点のクリッピング情報が第12〜17ビットに、三つ前の頂点のクリッピング情報が第18〜23ビットに、四つ前の頂点のクリッピング情報が第24〜29ビットに入っていることになる。
【0057】
つまり、三角形ポリゴンの場合には3頂点分の情報で、ポリゴンのクリッピング判定を行なうので、ORゲート62を用いて第0ビット〜17ビットの内一つでも「1」があるかどうかを判定し、「1」があればTRUE信号がメインプロセッサに出力され、クリッピング処理を行うべく分岐命令が実行される。
【0058】
このような構成を採用することにより、クリッピング用比較器によって、二つ必要だったクリッピング判定用の比較命令を一つにでき、高速に処理できる。また、クリッピングレジスタ6によって、常に最新5頂点分のクリッピング情報を保持でき、三角形ポリゴンの3頂点分のクリッピング情報から、五角形ポリゴンの5頂点分のクリッピング情報を保持できる。さらに、上述したクリッピング用比較器とクリッピングレジスタを用いることにより、前述したlist 1は以下に示すlist 2のようになり、クリッピング判定のプログラムのステップ数を短縮することができる。
【0059】
………ここからプログラムリスト……list 2………
;頂点1の座標変換
FMUL R32−R35,R0,R16−R19
FMAC R32−R35,R1,R20−R23
FMAC R32−R35,R2,R24−R27
FMAC R32−R35,R3,R28−R31
;頂点2の座標変換
FMUL R36−R39,R4,R16−R19
FMAC R36−R39,R5,R20−R23
FMAC R36−R39,R6,R24−R27
FMAC R36−R39,R7,R28−R31
;頂点3の座標変換
FMUL R40−R43,R8,R16−R19
FMAC R40−R43,R9,R20−R23
FMAC R40−R43,R10,R24−R27
FMAC R40−R43,R11,R28−R31
;クリッピング判定(wは正と仮定)
FCLIP R32−R34,R35;頂点1のクリッピング情報をクリッピングレジスタへ
FCLIP R36−R38,R39;頂点2のクリッピング情報をクリッピングレジスタへ
FCLIP R40−R32,R43;頂点2のクリッピング情報をクリッピングレジスタへ
BCT label ;最新3頂点分の情報を元にクリッピング処理へジャンプ
………ここまでプログラムリスト……list 2………
また、本実施例のクリッピングレジスタ6では、各頂点のクリッピング情報
(+x,−x,+y,−y,+z,−z)を保持しているため、該当ポリゴンが全てクリッピング領域外にあるかどうかのチェックを効率良く行える。
【0060】
例えば、三角形ポリゴンにおいては、頂点1の+xクリッピング情報ビット、頂点2の+xクリッピング情報ビット、頂点3の+xクリッピング情報ビットの全てが「1」の場合にそのポリゴンは全てクリッピング領域外にあり、表示する必要がないと判断できる。この場合、ORゲート62を頂点1の+x、頂点2の+x、頂点3の+xの論理積をとる論理ゲートに置き換えるようにすればよい。
【0061】
尚、ここでは、座標変換後の頂点nを3個(n=1、2、3)としたが、任意の個数の頂点(n≧3)を持つ多角形のポリゴンも全く同様に取り扱えることは自明である。つまり、必要に応じて、ORゲート62の入力ビット数を増やし、又、シフトレジスタ61のビット幅を大きくすればよい。
【0062】
【発明の効果】
以上説明したように、この発明によれば、座標変換後の出力座標ベクトル(xn ,yn ,zn )とwn のそれぞれの比較を1命令で行う構成を採用したので、クリッピング判定用の命令を少なくすることができ、かつクリッピング判定のプログラムのステップ数を削減できるので、クリッピング判定処理にかかる時間を短縮することができる。また、クリッピング判定用の比較情報を専用のレジスタに集めてクリッピング判定を行う構成を採用したので、1ポリゴン分のクリッピング判定を効率良く行なうことができる。
【図面の簡単な説明】
【図1】本発明の1実施例による座標変換処理回路を用いたグラフィックス処理システムを示す。
【図2】発明の一実施形態に係る座標変換処理回路の構成を示す図である。
【図3】クリッピング比較器の構成を示す図である。
【図4】クリッピングレジスタの構成を示す図である。
【図5】グラフィックス処理における座標変換を行う従来の座標変換処理回路の構成を示す図である。
【図6】図5に示すレジスタの構成を示す図である。
【図7】図5に示す演算器の構成を示す図である。
【符号の説明】
1,2 ソースバス
3 ディスティネーションバス
4 レジスタ
5x,5y,5z,5w,7x,7y,7z,7w 演算器
6 クリッピングレジスタ
51,52 入力レジスタ
53 比較器
54,55,62 論理ゲート
61 シフトレジスタ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a coordinate conversion processing circuit of a floating-point processor unit that executes coordinate conversion used for graphics drawing processing or the like.
[0002]
[Prior art]
In the graphics drawing process, the vertex coordinates of the polygon are converted from the three-dimensional coordinates to the two-dimensional coordinates for the display device. This coordinate transformation is obtained by calculating the product of a (4 × 4) matrix and a vector of four elements. It is necessary to perform clipping determination for checking whether or not the two-dimensional coordinates after the coordinate conversion are within the display area.
[0003]
In the graphics drawing process,
Figure 0003655723
Then,
[Expression 1]
Figure 0003655723
Therefore, coordinate transformation can be performed at high speed by repeating four product-sum arithmetic units in parallel four times. After the coordinate conversion is finished, a clipping check is performed to determine whether the converted coordinates are within the display area.
[0004]
Actually, if one point (x ′, y ′, z ′, w ′) after coordinate transformation is considered,
[Expression 2]
− | W ′ | <x ′ <| w ′ | (1 set)
− | W ′ | <y ′ <| w ′ | (2 formulas)
− | W ′ | <z ′ <| w ′ | (3 formulas)
When all the above formulas are true, it is within the region. This is called point clipping determination.
[0005]
If you are outside the area, you can check which direction you are traveling under the following conditions.
[0006]
[Equation 3]
| X ′ | <− | w ′ |: Out of x negative direction area (4 formulas)
| X ′ |> | w ′ |: Out of the positive x region (5)
| Y ′ | <− | w ′ |: Outside the negative y-direction region (Expression 6)
| Y ′ |> | w ′ |: Out of the positive y direction area (Expression 7)
| Z ′ | <− | w ′ |: Outside the region in the negative z direction (8 equations)
| Z ′ |> | w ′ |: Outside the positive z-direction region (Expression 9)
When drawing a polygon (n-gon), point clipping determination for n vertices is performed. As a result, if it is all within the area, it can be determined that the polygon is within the area and displayed as it is. If even one vertex is outside the area, the polygon is clipped and displayed. There are two cases when all the vertices of the polygon are out of the region. If all the vertices are outside the region in a certain direction, for example, if all the vertices satisfy (Equation 4), the polygon is not displayed. In other cases, for example, when the vertex 1 satisfies (Expression 4) and otherwise satisfies (Expression 5), the polygon is clipped and displayed.
[0007]
An example of a floating point processor that performs such coordinate conversion and clipping determination is shown in FIG.
[0008]
The floating point processor shown in FIG. 5 is designed as a coprocessor, and fetching and decoding of instructions are performed on the main processor side. In the conditional branch, a TRUE / FALSE signal is sent from the coprocessor side to the main processor side, and a conditional branch is performed on the main processor side by the signal.
[0009]
This floating-point processor has a 128-bit source bus 1 and a source bus 2, and a 128-bit destination bus 3, and also includes a register 4 as shown in FIG. 6 and arithmetic units 7x and 7y as shown in FIG. , 7z, 7w. Each 128-bit bus is divided into four groups of 32 bits. These are called x system, y system, z system, and w system.
[0010]
In the source bus 2 and the destination bus 3, the x-system bus is connected to registers (R0, R4, R8,...) In which the register number of the register 4 is divisible by 4, and the y-system bus is 1 is connected to the remaining registers (R1, R5, R9,...), The z-system bus is connected to the remaining registers (R2, R6, R10,. When the number is divided by 4, it is connected to three remaining registers (R3, R7, R11,...). The source bus 1 has a crossbar configuration in which all buses are connected to all registers.
[0011]
The calculators 7x, 7y, 7z, and 7w constitute product-sum calculators (FMACx, FMACy, FMACz, and FMACw), respectively, and can perform product-sum calculation, multiplication, addition, and subtraction in four parallel ways. A special operation such as a comparison operation is performed by the arithmetic unit 7w.
[0012]
By connecting as shown in FIG. 5, calculation of (4 × 4) matrix in coordinate transformation can be performed at high speed. The instructions and program examples used in matrix calculation are shown below.
[0013]
Description: The R number indicates the register number register.
[0014]
FMUL instruction
Four multiplications are performed in parallel.
[0015]
Figure 0003655723
Multiply four FMAC instructions in parallel.
[0016]
Figure 0003655723
Inverts the sign of a floating point number.
[0017]
Figure 0003655723
Compare floating point numbers. The comparison result is sent to the processor side using a TRUE / FALSE signal.
[0018]
Example:
FCMP eq R0, R1
If R0 and R1 are equal, a TRUE signal is sent. Otherwise, send a FALSE signal.
[0019]
FCMP ne R0, R1
If R0 and R1 are equal, a TRUE signal is sent. Otherwise, send a FALSE signal.
[0020]
FCMP gt R0, R1
If R0 is greater than R1, a TRUE signal is sent. Otherwise, send a FALSE signal.
[0021]
FCMP le R0, R1
If R0 is equal to or less than R1, a TRUE signal is sent. Otherwise, send a FALSE signal.
[0022]
FCMP lt R0, R1
If R0 is smaller than R1, a TRUE signal is sent. Otherwise, send a FALSE signal.
[0023]
FCMP eq R0, R1
If R0 is greater than or equal to R1, a TRUE signal is sent. Otherwise, send a FALSE signal.
[0024]
BCT instruction
When a TRUE signal is sent from the coprocessor, the process branches to LABEL.
[0025]
Example:
BCT label
Using these instructions, a program that performs coordinate conversion and clipping determination of polygons by triangles is written as follows.
[0026]
~ Correspondence between each data and register ~
Vertex 1: (R0, R1, R2, R3) of triangle polygon before conversion
Vertex 2 of triangle before conversion: (R4, R5, R6, R7)
Triangle polygon vertex 3 before conversion: (R8, R9, R10, R11)
Figure 0003655723
Vertex 1: of converted triangle polygon (R32, R33, R34, R35)
Vertex 2 of converted triangular polygon: (R36, R37, R38, R39)
Vertex 3 of converted triangular polygon: (R40, R41, R42, R43)
……… Program list from here …… List 1 ………
; Coordinate transformation of vertex 1
FMUL R32-R35, R0, R16-R19
FMAC R32-R35, R1, R20-R23
FMAC R32-R35, R2, R24-R27
FMAC R32-R35, R3, R28-R31
; Vertex 2 coordinate transformation
FMUL R36-R39, R4, R16-R19
FMAC R36-R39, R5, R20-R23
FMAC R36-R39, R6, R24-R27
FMAC R36-R39, R7, R28-R31
; Coordinate transformation of vertex 3
FMUL R40-R43, R8, R16-R19
FMAC R40-R43, R9, R20-R23
FMAC R40-R43, R10, R24-R27
FMAC R40-R43, R11, R28-R31
; Clipping judgment (assuming w is positive)
; Vertex 1
FCMP gt R32, R35; vertex 1: if x> w ...
BCT label; Jump to clipping process
FCMP gt R33, R35; vertex 1: if y> w ...
BCT label; Jump to clipping process
FCMP gt R34, R35; vertex 1: if z> w ...
BCT label; Jump to clipping process
FNEG gt R35, R35; R35 =-(R35)
FCMP lt R32, R35; vertex 1: if x <-w ...
BCT label; Jump to clipping process
FCMP lt R33, R35; vertex 1: if y <-w ...
BCT label; Jump to clipping process
FCMP lt R34, R35; vertex 1: if z <-w ...
BCT label; Jump to clipping process
; Vertex 2
FCMP gt R36, R39; vertex 2: if x> w ...
BCT label; Jump to clipping process
FCMP gt R37, R39; vertex 2: if y> w ...
BCT label; Jump to clipping process
FCMP gt R38, R39; vertex 2: if z> w ...
BCT label; Jump to clipping process
FNEG R39, R39; R39 =-(R39)
FCMP lt R36, R39; vertex 2: if x <-w ...
BCT label; Jump to clipping process
FCMP lt R37, R39; vertex 2: if y <-w ...
BCT label; Jump to clipping process
FCMP lt R38, R39; Vertex 2: If z <−w ...
BCT label; Jump to clipping process
Vertex 3
FCMP gt R40, R43; vertex 3: if x> w ...
BCT label; Jump to clipping process
FCMP gt R41, R43; vertex 3: if y> w ...
BCT label; Jump to clipping process
FCMP gt R42, R43; vertex 3: if z> w ...
BCT label; Jump to clipping process
FNEG R43, R43; R43 =-(R43)
FCMP lt R40, R43; vertex 3: if x <-w ...
BCT label; Jump to clipping process
FCMP lt R41, R43; vertex 3: if y <-w ...
BCT label; Jump to clipping process
FCMP lt R42, R43; vertex 3: if z <-w ...
BCT label; Jump to clipping process
……… Program list so far …… list 1 ………
[0027]
[Problems to be solved by the invention]
As described above, the conventional processor that performs coordinate transformation in graphics rendering processing combines two numerical comparison instructions and conditional branch instructions, so many instructions are needed for comparison and conditional branching for clipping determination. I was trying. For this reason, the malfunction that the coordinate conversion performance accompanied by a clipping determination will be caused.
[0028]
Accordingly, the present invention has been made in view of the above, and an object of the present invention is to provide a coordinate conversion processing circuit that efficiently performs clipping determination after coordinate conversion in graphics rendering processing.
[0029]
[Means for Solving the Problems]
In order to achieve the above object, the present invention performs perspective transformation of an input coordinate vector (x, y, z, 1) and outputs an output coordinate vector (x ′, y ′, z ′, w ′) as a result of the transformation. Four coordinate transformation circuits that output each element of Of the coordinate conversion circuit that outputs the output coordinate vector (x ′, y ′, z ′). Provided for each, Concerned By comparing each coordinate value of the output coordinate vector (x ′, y ′, z ′) with the value of the output coordinate vector (w ′), it is determined whether or not each coordinate is within the display area. Three comparison circuits and a clipping register for storing an output from the comparison circuit The coordinate conversion circuit that outputs the output coordinate vector (w ′) converts the output coordinate vector (w ′) that is the conversion result into a coordinate conversion circuit that outputs the output coordinate vector (x ′, y ′, z ′). Input It is characterized by that.
[0030]
In the above invention, the value of the output coordinate vector is represented by a field indicating a sign and an absolute value, respectively, and the comparison circuit compares the field indicating the absolute value with each other, the output from the comparator, and the A first circuit that outputs a logical product of coordinate values of output coordinate vectors (x ′, y ′, z ′), an inverted signal of an output from the comparator, and the output coordinate vectors (x ′, y ′); , Z ′) and a second circuit that outputs a logical product of the coordinate values of the respective coordinate values.
[0031]
In the above invention, the clipping register is a shift register, and the output from the comparison circuit can be saved by a shift operation.
[0032]
In the above invention, the clipping register preferably includes a logic circuit that outputs a logic signal based on the determination result stored in a shift register corresponding to a plurality of coordinate vectors.
[0033]
In the above invention, the logic circuit is preferably an OR gate.
[0034]
In the above invention, the comparison circuit outputs a signal indicating that x ′ is outside the display area when x ′> | w ′ | or x ′ <− | w ′ |, and y ′> | w ′. When | or y ′ <− | w ′ |, a signal indicating that y ′ is outside the display area is output, and when z ′> | w ′ | or z ′ <− | w ′ | It is preferable to output a signal indicating that is outside the display area.
[0035]
In the above invention, each of the comparison circuits includes a case where each coordinate value of the output coordinate vector (x ′, y ′, z ′) is within the display area for each coordinate, and It is preferable to output a 2-bit identification signal indicating whether the display area is out of the positive direction or the display area is out of the negative direction.
In the above invention, the clipping register is a 6 × n-bit (n> 1) shift register, and the 6-bit register portion receives the identification signal of the comparison circuit, and sequentially shifts to other portions by a 6-bit shift operation. It is preferable to evacuate.
Furthermore, in the above invention, it is preferable that the clipping register is a shift register of at least 18 bits, and an output circuit for outputting the logical product of 18 bits is connected.
Moreover, it is preferable to perform the determination by the three comparators in parallel.
Further, it is preferable that the output coordinate vector (x ′, y ′, z ′, w ′) is a vertex coordinate of the polygon in the graphics drawing process.
[0036]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings.
[0037]
FIG. 1 shows a graphics processing system using a coordinate conversion processing circuit according to one embodiment of the present invention.
[0038]
In this system, a processor 1, a graphics processor unit (hereinafter referred to as “GPU”) 3, and a main memory 5 are respectively connected by a main bus 7, and a graphics memory 9 is connected to the GPU 3 with graphics. They are connected by a bus 11.
[0039]
The GPU 3 has a pre-processing unit 13 and a main processing unit 15. The main processing unit 15 uses DDA to render the pixels of the output image using the texture information read from the graphics memory 9, and displays the result as a graphic. Write to the frame buffer on the memory 9. Further, the preprocessing unit 13 calculates parameters such as an initial value and a difference value of the DDA of the main process.
[0040]
The processor 1 reads the program from the main memory 5 by the processor core 17 and executes it. The processor core 17 creates two-dimensional coordinates and color information (hereinafter referred to as “GPU command information”) of the vertices of the polygon to be drawn on the screen according to the program. At that time, the coordinate transformation unit 19 is used to create a two-dimensional coordinate from the three-dimensional coordinate. Further, according to the program, the processor 1 adds additional information (identification command as to what polygon is drawn) to the GPU command information, and sends it as a GPU command to the GPU 3 through the main bus 7, and the GPU 3 executes drawing. Note that it is possible to send information using a dedicated bus without using the main bus 7. Further, when the speed of creating the GPU command of the processor 1 and the drawing speed of the GPU 3 are not balanced (such as which is slower), the GPU command is buffered on the main memory 5 to absorb the speed difference.
[0041]
FIG. 2 shows the configuration of the coordinate conversion processing circuit 19. Compared with the coordinate transformation processing circuit shown in FIG. 5, the coordinate transformation processing circuit of this embodiment has the same functions as the arithmetic units 7x, 7y, and 7z shown in FIG. 4 y and 4 z are provided, and arithmetic units 5 x, 5 y, 5 z and a clipping register 6 shown in FIG. 4 are provided, and the other configurations are the same as those in FIG. 5.
[0042]
In FIG. 3, clipping comparators 4x, 4y, and 4z receive the output coordinate vector (xn, yn, zn, wn) of the vertex n (n = 1, 2, 3) after coordinate transformation and receive xn. And wn are compared to determine xn> | wn | or xn <-| wn | or xn≥ | wn | or xn≤- | wn |, and yn is compared with wn> | wn | or yn < − | Wn | or yn ≧ | wn | or yn ≦ − | wn | is discriminated, zn and wn are compared, and zn> | wn | or zn <− | wn | or zn ≧ | wn | or zn ≦ − An operation for discriminating | wn | and outputting each discrimination result by one comparison instruction, and holding the output coordinate vector (xn, yn, zn, wn) of the vertex n after coordinate transformation including the sign Registers 51 and 52 and an output coordinate vector ( xn, yn, zn) and the magnitude relationship between the output coordinate vectors wn held in the input register 52, the comparison result of the comparator 53, and the sign of the output coordinate vector held in the input register 51, respectively. A logical product (AND) gate 54 for inputting an inverted value and discriminating xn> wn or yn> wn or zn> wn or xn ≥wn or yn ≥wn or zn ≥wn, the comparison result of the comparator 53 and the input register An AND gate 55 for inputting the sign of the output coordinate vector held in 51 and discriminating xn <-wn or yn <-wn or zn <-wn or xn ≤ -wn or yn ≤ -wn or zn ≤ -wn It is prepared for.
[0043]
In FIG. 4, the clipping register 6 includes a shift register 61 and a logical sum (OR) gate 62. A logical sum (OR) gate 62 outputs an 18-bit bit product on the right side of the shift register 61.
[0044]
By executing the comparison instruction, the shift register 61 shifts 6 bits to the left in order to receive the respective discrimination results output from the clipping comparators of the arithmetic units 5x, 5y, and 5z. That is, in the series of processing, after shifting the discrimination result of the previous output coordinate vector (xn-1, yn-1, zn-1, wn-1) of the vertex (n-1), the next clipping discrimination result Are received in the right 6 bits. Then, at the stage where the discrimination results are equal to n vertices (here, 3 vertices), there are vertices for which discrimination by the clipping comparator is established from the discrimination results of the n-gon (triangular) polygons that are shifted in and held. Whether or not to perform clipping is determined by the shift register 61. If there is a vertex to be clipped, a signal for executing a branch instruction for executing clipping processing is output.
[0045]
In the clipping comparator shown in FIG. 3, the input register 51 receives an x value for the computing unit 5x, a y value for the computing unit 5y, and a z value for the computing unit 5z. The same w value is input to the input register 52 in any of the arithmetic units 5x, 5y, 5z.
[0046]
The input x will be described as a representative. The sign bit of the input x and the sign bit of the input w are separated, and only the numeric field is input to the comparator 53. Here, the numerical field of input x, y, z is input 1 and the numerical field of input w is input 2. Here, the numeric field is composed of a floating point exponent part and a mantissa part.
[0047]
The comparison result of the comparator 53 is “1” when input 1> input 2, and “0” otherwise. The comparison condition may be input 1 ≧ input 2. Further, the inverted value of the sign bit of the inputs x, y, and z is set as one input of the AND gate 54, and the sign bit of the inputs x, y, and z is set as one input of the AND gate 55.
[0048]
In the configuration shown in FIG. 4, the comparator 53 compares the absolute values of the input x and the input w. When | x |> | w | and x ≧ 0 (that is, x> w), the output of the AND gate 54 is used. + Clipping Info. Becomes “1”, and when | x |> | w | and x <0 (that is, x <−w), the output of the AND gate 55 is −Clipping Info. Becomes “1” (assuming w is positive).
[0049]
Next, outputs from the respective comparators for clipping of the arithmetic units 5x, 5y, 5z, 5w, + x Clipping Info. , + Y Clipping Info. , + Z Clipping Info. , -X Clipping Info. , -Y Clipping Info. , -Z Clipping Info. Are input to the clipping register 6.
[0050]
The clipping comparators are simultaneously executed by the clipping comparators of the arithmetic units 5x, 5y, and 5z by the FCLIP instruction. The FCLIP instruction performs a clipping comparison after a 6-bit left shift and performs a clipping determination. Details are as follows.
[0051]
FCLIP command operation example
FCLIP R0-R3, R4
(1) First action
Shift register 61 is shifted 6 bits to the left.
[0052]
(2) Second operation
R0 (input x) and R4 (input w) are compared by the clipping comparator of the calculator 5x. R1 (input y) and R4 (input w) are compared by the clipping comparator of the calculator 5y. R2 (input z) and R4 (input w) are compared by the clipping comparator of the calculator 5z.
[0053]
(3) Third action
Clipping judgment
If even one of the lower 18 bits of the shift register 61 is “1”, a TRUE signal is sent to the main processor.
[0054]
The first operation and the second operation are independent and are performed in parallel.
[0055]
As shown in FIG. 5, the shift register 61 constituting the clipping register 6 is a 32-bit register, for example, and the least significant 6 bits are connected to the output of the clipping comparator. The 0th bit is + Clipping Info. The first bit is + Clipping Info. The second bit is + Clipping Info. The third bit is + Clipping Info. 4th bit is + Clipping Info. 5th bit is + Clipping Info. Are connected to each other.
[0056]
Since the shift register 61 is shifted left by 6 bits each time the FCLIP instruction is executed, the clipping information of the latest vertex is always in the 0th to 5th bits, and the clipping information of the previous vertex is in the 6th to 11th bits. In addition, the clipping information of the previous vertex is in bits 12 to 17, the clipping information of the previous vertex is in bits 18 to 23, and the clipping information of the previous vertex is in bits 24 to 29. Will be.
[0057]
That is, in the case of a triangular polygon, polygon clipping is determined using information for three vertices. Therefore, the OR gate 62 is used to determine whether any one of the 0th to 17th bits is “1”. , “1”, a TRUE signal is output to the main processor, and a branch instruction is executed to perform clipping processing.
[0058]
By adopting such a configuration, the two comparators for determining the clipping required by the clipping comparator can be combined into one and processed at high speed. The clipping register 6 can always hold the clipping information for the latest five vertices, and the clipping information for the five vertices of the pentagonal polygon can be held from the clipping information for the three vertices of the triangular polygon. Further, by using the above-described clipping comparator and the clipping register, the above-described list 1 becomes the following list 2 and the number of steps of the clipping determination program can be shortened.
[0059]
……… Program list from here …… list 2 …………
; Coordinate transformation of vertex 1
FMUL R32-R35, R0, R16-R19
FMAC R32-R35, R1, R20-R23
FMAC R32-R35, R2, R24-R27
FMAC R32-R35, R3, R28-R31
; Vertex 2 coordinate transformation
FMUL R36-R39, R4, R16-R19
FMAC R36-R39, R5, R20-R23
FMAC R36-R39, R6, R24-R27
FMAC R36-R39, R7, R28-R31
; Coordinate transformation of vertex 3
FMUL R40-R43, R8, R16-R19
FMAC R40-R43, R9, R20-R23
FMAC R40-R43, R10, R24-R27
FMAC R40-R43, R11, R28-R31
; Clipping judgment (assuming w is positive)
FCLIP R32-R34, R35; Clip information of vertex 1 to clipping register
FCLIP R36-R38, R39; Clipping information of vertex 2 to clipping register
FCLIP R40-R32, R43; Clip information of vertex 2 to clipping register
BCT label: Jump to clipping process based on the latest 3 vertex information
……… List of programs so far …… list 2 ………
In the clipping register 6 of this embodiment, the clipping information of each vertex
Since (+ x, -x, + y, -y, + z, -z) are held, it is possible to efficiently check whether or not the corresponding polygons are all outside the clipping region.
[0060]
For example, in the case of a triangular polygon, if all of the + x clipping information bit for vertex 1, the + x clipping information bit for vertex 2, and the + x clipping information bit for vertex 3 are all “1”, the polygons are all outside the clipping region and displayed It can be judged that there is no need to do. In this case, the OR gate 62 may be replaced with a logic gate that takes the logical product of + x of the vertex 1, + x of the vertex 2, and + x of the vertex 3.
[0061]
Although the number of vertexes n after coordinate conversion is three (n = 1, 2, 3) here, a polygonal polygon having an arbitrary number of vertices (n ≧ 3) can be handled in exactly the same way. It is self-explanatory. That is, if necessary, the number of input bits of the OR gate 62 may be increased and the bit width of the shift register 61 may be increased.
[0062]
【The invention's effect】
As described above, according to the present invention, since the configuration in which each of the output coordinate vectors (xn, yn, zn) and wn after coordinate conversion is compared with one command is adopted, the number of commands for clipping determination is reduced. Since the number of steps of the clipping determination program can be reduced, the time required for the clipping determination process can be shortened. In addition, since a configuration is adopted in which comparison information for clipping determination is collected in a dedicated register and clipping determination is performed, clipping determination for one polygon can be performed efficiently.
[Brief description of the drawings]
FIG. 1 shows a graphics processing system using a coordinate transformation processing circuit according to an embodiment of the present invention.
FIG. 2 is a diagram showing a configuration of a coordinate transformation processing circuit according to an embodiment of the invention.
FIG. 3 is a diagram illustrating a configuration of a clipping comparator.
FIG. 4 is a diagram illustrating a configuration of a clipping register.
FIG. 5 is a diagram illustrating a configuration of a conventional coordinate conversion processing circuit that performs coordinate conversion in graphics processing.
6 is a diagram showing a configuration of a register shown in FIG. 5. FIG.
7 is a diagram showing a configuration of a computing unit shown in FIG. 5. FIG.
[Explanation of symbols]
1, 2 source bus
3 Destination bus
4 registers
5x, 5y, 5z, 5w, 7x, 7y, 7z, 7w
6 Clipping register
51,52 Input register
53 comparator
54, 55, 62 logic gates
61 Shift register

Claims (12)

入力座標ベクトル(x、y、z、1)の透視変換を行い、その変換結果として出力座標ベクトル(x´、y´、z´、w´)の各要素を出力する4つの座標変換回路と、
出力座標ベクトル(x´、y´、z´)を出力する座標変換回路の夫々について設けられ、当該出力座標ベクトル(x´、y´、z´)の夫々の座標値を出力座標ベクトル(w´)の値と比較することによって、夫々の座標についてその表示領域内に収まっている否か判定する3つの比較回路と、
前記比較回路からの出力を格納するクリッピングレジスタと
を備え
出力座標ベクトル(w´)を出力する座標変換回路は、変換結果である該出力座標ベクトル(w´)を、出力座標ベクトル(x´、y´、z´)を出力する座標変換回路に入力させることを特徴とする座標変換処理回路。
Four coordinate conversion circuits that perform perspective transformation of the input coordinate vector (x, y, z, 1) and output each element of the output coordinate vector (x ′, y ′, z ′, w ′) as the transformation result; ,
Provided for each of the coordinate transformation circuits that output the output coordinate vectors (x ′, y ′, z ′), and the respective coordinate values of the output coordinate vectors (x ′, y ′, z ′) are output coordinate vectors (w Three comparison circuits for determining whether or not each coordinate is within the display area by comparing with the value of ′);
A clipping register for storing the output from the comparison circuit ;
The coordinate conversion circuit that outputs the output coordinate vector (w ′) inputs the output coordinate vector (w ′) that is the conversion result to the coordinate conversion circuit that outputs the output coordinate vector (x ′, y ′, z ′). coordinate conversion processing circuit, characterized in that cause.
前記出力座標ベクトルの値は、夫々符号と絶対値を示すフィールドで表され、前記比較回路は、絶対値を示すフィールド同士を比較する比較器と、前記比較器からの出力と前記出力座標ベクトル(x´、y´、z´)の各々の座標値の論理積を出力する第1の回路と、前記比較器からの出力の反転信号と前記出力座標ベクトル(x´、y´、z´)の各々の座標値の論理積を出力する第2の回路とからなることを特徴とする請求項1に記載の座標変換処理回路。  The value of the output coordinate vector is represented by a field indicating a sign and an absolute value, and the comparison circuit compares a field indicating the absolute value with each other, an output from the comparator, and the output coordinate vector ( a first circuit that outputs a logical product of the coordinate values of x ′, y ′, z ′), an inverted signal of the output from the comparator, and the output coordinate vector (x ′, y ′, z ′). The coordinate conversion processing circuit according to claim 1, further comprising: a second circuit that outputs a logical product of each coordinate value. 前記クリッピングレジスタはシフトレジスタであり、前記比較回路からの出力をシフト動作によって退避しておくこと特徴とする請求項1に記載の座標変換処理回路。  2. The coordinate conversion processing circuit according to claim 1, wherein the clipping register is a shift register, and an output from the comparison circuit is saved by a shift operation. 前記クリッピングレジスタは、複数の座標ベクトルに対応するシフトレジスタに格納された前記判別結果に基く論理信号を出力する論理回路を有することを特徴とする請求項1に記載の座標変換処理回路。  The coordinate conversion processing circuit according to claim 1, wherein the clipping register includes a logic circuit that outputs a logic signal based on the determination result stored in a shift register corresponding to a plurality of coordinate vectors. 前記論理回路は、論理和ゲートであることを特徴とする請求項4に記載の座標変換処理回路。  5. The coordinate transformation processing circuit according to claim 4, wherein the logic circuit is an OR gate. 前記比較回路は、x´>|w´|又はx´<−|w´|の場合にx´が表示領域外であることを示す信号を出力し、y´>|w´|又はy´<−|w´|の場合にy´が表示領域外であることを示す信号を出力し、z´>|w´|又はz´<−|w´|の場合にz´が表示領域外であることを示す信号を出力すること特徴とする請求項1に記載の座標変換処理回路。  The comparison circuit outputs a signal indicating that x ′ is outside the display area when x ′> | w ′ | or x ′ <− | w ′ |, and y ′> | w ′ | or y ′. In the case of <-| w '|, a signal indicating that y' is outside the display area is output, and in the case of z '> | w' | or z '<-| w' |, z 'is outside the display area. The coordinate conversion processing circuit according to claim 1, wherein a signal indicating that is output. 前記比較回路の夫々は、前記出力座標ベクトル(x´、y´、z´)の夫々の座標値が、夫々の座標について表示領域内に収まっている場合と、その表示領域の正の方向に外れている場合と、その表示領域の負の方向に外れている場合とのいずれであるかを示す2ビットの識別信号を出力することを特徴とする請求項6に記載の座標変換処理回路。  Each of the comparison circuits includes a case where each coordinate value of the output coordinate vector (x ′, y ′, z ′) is within the display area with respect to each coordinate, and a positive direction of the display area. 7. The coordinate conversion processing circuit according to claim 6, wherein a 2-bit identification signal indicating whether the display area is off or the display area is off in the negative direction is output. 前記クリッピングレジスタは、6xnビット(n>1)のシフトレジスタであり、6ビット分のレジスタ部分が前記比較回路の識別信号を受け、6ビットのシフト動作によって順次他の部分に退避しておくこと特徴とする請求項7に記載の座標変換処理回路。  The clipping register is a 6 × n-bit (n> 1) shift register, and the 6-bit register portion receives the identification signal of the comparison circuit and is sequentially saved in another portion by a 6-bit shift operation. The coordinate conversion processing circuit according to claim 7, wherein: 前記クリッピングレジスタは、少なくとも18ビットのシフトレジスタであり、この18ビットの論理積を出力する出力回路が接続されていること特徴とする請求項8に記載の座標変換処理回路。  9. The coordinate conversion processing circuit according to claim 8, wherein the clipping register is a shift register of at least 18 bits, and an output circuit that outputs the logical product of 18 bits is connected. 前記3つの比較器による判定を、並列に行うことを特徴とする請求項1乃至9に記載の座標変換処理回路。  The coordinate conversion processing circuit according to claim 1, wherein the determination by the three comparators is performed in parallel. 前記出力座標ベクトル(x´、y´、z´、w´)は、グラフィックス描画処理におけるポリゴンの頂点座標であることを特徴とする請求項1乃至10に記載の座標変換処理回路。  11. The coordinate conversion processing circuit according to claim 1, wherein the output coordinate vector (x ′, y ′, z ′, w ′) is a vertex coordinate of a polygon in graphics rendering processing. 4つの座標変換回路により、入力座標ベクトル(x、y、z、1)Input coordinate vector (x, y, z, 1) by four coordinate conversion circuits の透視変換を行い、その変換結果として出力座標ベクトル(x´、y´、z´、w´)の各要素を出力し、And outputs each element of the output coordinate vector (x ′, y ′, z ′, w ′) as the conversion result,
出力座標ベクトル(w´)を出力する座標変換回路から、変換結果である該出力座標ベクトル(w´)を、出力座標ベクトル(x´、y´、z´)を出力する座標変換回路に入力させ、  From the coordinate conversion circuit that outputs the output coordinate vector (w ′), the output coordinate vector (w ′) that is the conversion result is input to the coordinate conversion circuit that outputs the output coordinate vector (x ′, y ′, z ′). Let
出力座標ベクトル(x´、y´、z´)を出力する座標変換回路の夫々について設けられた3つの比較回路により、当該出力座標ベクトル(x´、y´、z´)の夫々の座標値を出力座標ベクトル(w´)の値と比較することによって、夫々の座標についてその表示領域内に収まっている否か判定し、  Each of the coordinate values of the output coordinate vector (x ′, y ′, z ′) is obtained by three comparison circuits provided for each of the coordinate conversion circuits that output the output coordinate vector (x ′, y ′, z ′). Is compared with the value of the output coordinate vector (w ′) to determine whether each coordinate is within the display area,
前記比較回路からの出力をクリッピングレジスタに格納する  The output from the comparison circuit is stored in a clipping register.
ことを特徴とする座標変換処理方法。A coordinate conversion processing method characterized by that.
JP01935597A 1996-02-02 1997-01-31 Coordinate transformation processing circuit for performing coordinate transformation and clipping determination Expired - Fee Related JP3655723B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01935597A JP3655723B2 (en) 1996-02-02 1997-01-31 Coordinate transformation processing circuit for performing coordinate transformation and clipping determination

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP1789696 1996-02-02
JP8-17896 1996-02-02
JP01935597A JP3655723B2 (en) 1996-02-02 1997-01-31 Coordinate transformation processing circuit for performing coordinate transformation and clipping determination

Publications (2)

Publication Number Publication Date
JPH09270017A JPH09270017A (en) 1997-10-14
JP3655723B2 true JP3655723B2 (en) 2005-06-02

Family

ID=26354484

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01935597A Expired - Fee Related JP3655723B2 (en) 1996-02-02 1997-01-31 Coordinate transformation processing circuit for performing coordinate transformation and clipping determination

Country Status (1)

Country Link
JP (1) JP3655723B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4300001B2 (en) 2002-07-31 2009-07-22 ソニー株式会社 Clipping device

Also Published As

Publication number Publication date
JPH09270017A (en) 1997-10-14

Similar Documents

Publication Publication Date Title
US8106914B2 (en) Fused multiply-add functional unit
US7724261B2 (en) Processor having a compare extension of an instruction set architecture
US6115047A (en) Method and apparatus for implementing efficient floating point Z-buffering
JP4148560B2 (en) Floating point division arithmetic unit
US8615542B2 (en) Multi-function floating point arithmetic pipeline
US6873324B2 (en) Data processing method, recording medium and data processing apparatus
US7298375B1 (en) Arithmetic logic units in series in a graphics pipeline
US20120059866A1 (en) Method and apparatus for performing floating-point division
US6175370B1 (en) Geometry translation processor
KR101973924B1 (en) Per-shader preamble for graphics processing
US7280112B1 (en) Arithmetic logic unit temporary registers
US6282628B1 (en) Method and system for a result code for a single-instruction multiple-data predicate compare operation
US6732259B1 (en) Processor having a conditional branch extension of an instruction set architecture
JP4300001B2 (en) Clipping device
JP3655723B2 (en) Coordinate transformation processing circuit for performing coordinate transformation and clipping determination
JPH0869538A (en) Method and equipment for execution of clip check by using out code
US20020143838A1 (en) Parallel arithmetic apparatus, entertainment apparatus, processing method, computer program and semiconductor device
CN116664735B (en) Large-scale animation rendering method, device, equipment and medium for virtual object
JPH10293853A (en) Clip processor
KR20110073361A (en) Parallel and vectored gilbert-johnson-keerthi graphics processing
JPH07295787A (en) Arithmetic processor
JP2002536763A (en) Processor with instruction set structure comparison extension
US5896135A (en) System and method for generating 3D color images with simulated light sources
EP2600241B1 (en) VLIW processor, instruction structure, and instruction execution method
JPH09330419A (en) Graphic area discriminating device

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20011211

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20011211

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041013

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041026

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041227

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041227

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: 20050215

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050304

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

Free format text: PAYMENT UNTIL: 20080311

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090311

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100311

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees