KR20040011920A - scan conversion unit in tiling-traveresal algorithm and method of the same - Google Patents

scan conversion unit in tiling-traveresal algorithm and method of the same Download PDF

Info

Publication number
KR20040011920A
KR20040011920A KR1020020045236A KR20020045236A KR20040011920A KR 20040011920 A KR20040011920 A KR 20040011920A KR 1020020045236 A KR1020020045236 A KR 1020020045236A KR 20020045236 A KR20020045236 A KR 20020045236A KR 20040011920 A KR20040011920 A KR 20040011920A
Authority
KR
South Korea
Prior art keywords
stamp
tiling
unit
triangle
traversal
Prior art date
Application number
KR1020020045236A
Other languages
Korean (ko)
Other versions
KR100487461B1 (en
Inventor
최문희
박우찬
김신덕
한탁돈
Original Assignee
학교법인연세대학교
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 학교법인연세대학교 filed Critical 학교법인연세대학교
Priority to KR10-2002-0045236A priority Critical patent/KR100487461B1/en
Publication of KR20040011920A publication Critical patent/KR20040011920A/en
Application granted granted Critical
Publication of KR100487461B1 publication Critical patent/KR100487461B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/28Indexing scheme for image data processing or generation, in general involving image processing hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details

Abstract

PURPOSE: A tiling-traversal type scan conversion stage and a method therefor are provided to reduce the necessary cost by applying a manhattan neighbor method and reduce delay of a pipe line by minimizing frequently generated branches. CONSTITUTION: A half-plane edge function is executed to four search points of a stamp and three edges of a triangle(10). All movable directions of the current stamp are obtained based on estimation results of the four search points(20). A final direction is selected by examining stored contexts, a final flag controlling the stored contexts, and tile boundary(30). If up and down contexts are not empty, a stamp stored in the contexts is designated as a stamp to be proceeded next(40).

Description

타일링 트래버설 방식의 주사변환 유닛 및 방법{scan conversion unit in tiling-traveresal algorithm and method of the same}Scan conversion unit in tiling-traveresal algorithm and method of the same}

본 발명은 3차원 그래픽 시스템에 관한 것으로, 특히 타일링 트래버설 방식을 기반으로 한 고성능의 파이프라인된 주사변환 유닛 및 방법에 관한 것이다.The present invention relates to a three-dimensional graphics system, and more particularly, to a high performance pipelined scan conversion unit and method based on a tiling traversal scheme.

현재의 3차원 그래픽스 분야에서는 실시간 3차원 환경의 구현을 목표로, 엄청난 연산 수행 능력과 메모리 대역폭을 가진 고성능 그래픽 시스템에 대한 요구가 증대되어지고 있으며, 이와 더불어 고성능 주사 변환 유닛도 필수 요소가 되고 있다.In the current 3D graphics field, the demand for a high performance graphics system with enormous computational performance and memory bandwidth is increasing, with the aim of real-time 3D environment, and a high performance scan conversion unit is also an essential element. .

일반적으로 3차원 그래픽 시스템은 역할이 뚜렷한 여러 단계들이 파이프라인으로 구성되어 있는데, 크게 기하학 처리 부분(geometry processing step)과 래스터라이제이션 부분(rasterization step)으로 나뉘어서 방대한 양의 데이터를 처리한다.In general, a 3D graphics system is composed of pipelines with distinct roles, which are divided into a geometry processing step and a rasterization step to process a large amount of data.

이때, 주사 변환 유닛(scan conversion stage)은 화면에 출력될 최종의 픽셀값을 구하는 래스터라이제이션 부분의 맨 상단에 위치하여, 기하학 처리 부분에서 입력된 삼각형 정보를 근거로 하여 여러 증분 값들(gradients values)과 초기 픽셀 프래그먼트들(fragments)을 구하는 작업을 수행한다.In this case, the scan conversion stage is located at the top of the rasterization part for obtaining the final pixel value to be output on the screen, and based on the triangle information input from the geometry processing part, several gradient values are obtained. ) And initial pixel fragments.

그리고 일반적인 주사 변환 유닛은 삼각형 셋업(triangle set-up), 변 처리(edge processing), 스팬 처리(span processing)로 이루어진다.The general scan conversion unit is composed of triangle set-up, edge processing, and span processing.

이런 주사 변환 유닛에 적용되는 대표적인 알고리즘으로는 스캔-라인 알고리즘(scan-line algorithm)과 타일링 트래버설 알고리즘(tiling-traversal algorithm)이 있다.Representative algorithms applied to such a scan conversion unit include a scan-line algorithm and a tiling-traversal algorithm.

상기 스캔-라인 알고리즘이 적용된 경우(이하 스캔-라인 방식)는 동작 방식이 명확하고 간단하여 파이프라인으로 구성하기 쉽기 때문에 초기 주사변환 유닛에 널리 사용되어졌다.When the scan-line algorithm is applied (hereinafter, the scan-line method) has been widely used in the initial scan conversion unit because the operation method is clear and simple and easy to configure as a pipeline.

그러나 삼각형의 각 변마다 나누기 연산을 요구되어 역 기울기값들을 반드시 계산해야 하고, 병렬적으로 프래그먼트들의 생성이 어려워서 몇 개의 점들에서 프래그먼트를 생성해야 하는 수퍼샘플링(super sampling)된 안티알리아싱(antialiasing) 렌더링과 같은 경우에는 그 적용에 어려움이 있다.However, a supersampled antialiasing rendering that requires dividing operations on each side of the triangle to compute inverse gradient values and difficult to generate fragments in parallel, creating fragments at several points. In this case, there is a difficulty in the application.

또한 렌더링하는 과정에서 페이지 교차(page crossing)가 자주 발생하여 메모리 대역폭을 많이 낭비하는 치명적인 약점을 가진다.In addition, page crossings occur frequently during rendering, which is a fatal weakness that wastes a lot of memory bandwidth.

이에 반하여, 반-평면 변 함수(half-plane edge function)를 기반으로 한 상기 타일링-트래버설 알고리즘을 적용한 경우(이하 타일링-트래버설 방식)는 스탬프를 이용해서 쉽게 여러 개의 프래그먼트들을 병렬적으로 생성할 수 있고, 메모리접근에 있어 페이지 교차의 생성 빈도를 줄여 메모리 운용에 효과적이다. 또한, 텍스처 캐쉬의 사용에 있어서도 적중 실패율을 낮추어 성능 향상을 꾀할 수 있다.In contrast, when applying the tiling-traversal algorithm based on a half-plane edge function (hereinafter, referred to as a tiling-traversal method), it is easy to generate several fragments in parallel using a stamp. It is effective in memory operation by reducing the frequency of page intersections in memory access. In addition, even in the use of the texture cache, it is possible to reduce the hit failure rate to improve performance.

그러나, 삼각형의 트래버설 과정에서 분기(branch)가 자주 발생하게 되고, 그때마다 파이프라인이 지연(stall)되므로, 파이프라인 구조의 성능을 크게 저하시키는 단점을 가진다.However, a branch frequently occurs in the traversal process of the triangle, and the pipeline is stalled at each time, and thus has a disadvantage of significantly degrading the performance of the pipeline structure.

이와 같은 스캔-라인 방식과 타일링-트래버설 방식을 좀더 상세히 설명하기 위해 메모리 효율성 측면과 텍스처 캐쉬 접근 측면에서 설명하면 다음과 같다.In order to describe the scan-line method and the tiling-traversal method in detail, the memory efficiency and the texture cache access are described as follows.

먼저, 메모리 효율성 측면을 보면, 현재 널리 사용되고 있는 멀티-뱅크 DRAM(multi-bank DRAM)의 경우는 하나의 열(row)을 접근(access)하는 동안 다른 열에는 접근 할 수 없다.First, in terms of memory efficiency, multi-bank DRAMs, which are widely used now, cannot access one row while accessing one row.

따라서, 한 페이지에 대한 접근이 모두 끝난 후에 같은 뱅크 내의 두 번째 페이지에 대한 접근이 시도되는데, 이 경우에는 선인출/열 활성화(precharge/row activate) 명령 시퀀스가 요구된다.Thus, after access to one page is finished, access to the second page in the same bank is attempted, in which case a precharge / row activate command sequence is required.

이 선인출/열 활성화 명령 시퀀스는 새로운 페이지에 접근하는 경우에 발생하는 것으로 이미 열려진 페이지에 접근하는 경우는 발생하지 않는다.This prefetch / column activation command sequence occurs when a new page is accessed, but not when a page that has already been opened is accessed.

따라서, 불필요하게 페이지 교차가 많이 이뤄지면 그 만큼의 사이클이 낭비되는 것이다.Therefore, unnecessary cycles of pages are wasteful.

도 1 은 스캔-라인 방식과 타일링-트래버설 방식의 메모리 접근 형태를 보여주는 도면으로, 화면을 DRAM의 페이지 크기에 맞춰 타일화 시켰다.FIG. 1 illustrates a scan-line and tiling-traversal type of memory access, in which a screen is tiled according to a page size of a DRAM.

스캔-라인 방식에서는 도 1(a)과 같이, 스캔 라인별로 픽셀을 생성하므로 여러 페이지로의 접근이 빈번히 일어나게 된다.In the scan-line method, as shown in FIG. 1A, pixels are generated for each scan line, and thus access to several pages occurs frequently.

이에 따라 페이지 교차가 자주 발생하게 되고, 여러 사이클이 낭비되게 된다.This results in frequent page crossings and wasteful cycles.

반면에 타일링 트래버설 방식은 도 1(b)과 같이, 타일 별(1,2,3,4,5,6,7,8,9)로 픽셀을 생성하고 있기 때문에, 스캔-라인 방식에 비해 페이지 교차가 덜 발생되는 효과를 얻게 된다. 그리고 한 뱅크의 페이지를 접근하고 있는 동안에 다른 뱅크의 페이지로의 접근을 준비할 수 있기 때문에 선인출 효과도 얻을 수 있게 된다.On the other hand, the tiling traversal method generates pixels by tiling (1, 2, 3, 4, 5, 6, 7, 8, 9) as shown in FIG. This results in less page crossings. And while accessing pages in one bank, it is possible to prepare for access to pages in another bank, so that a prefetching effect can be obtained.

즉, 프레임 버퍼 (frame buffer)는 각각의 타일로 구분되어져 있기 때문에 도 1(b)과 같이 두 개의 뱅크를 바둑판 모양으로 교차시켜주어 그 효과를 증대시킬 수 있다.That is, since the frame buffer is divided into tiles, as shown in FIG. 1 (b), two banks may be crossed in a checkerboard shape to increase the effect.

만약 타일 내의 생성될 데이터가 적은 경우에는 선인출 할 시간이 부족하게 되므로 어쩔 수 없이 페이지 교차가 발생하게 된다. 그러나 이런 경우가 존재하더라도 상기 타일링-트래버설 방식이 상기 스캔-라인 방식의 경우보다는 페이지 교차 빈도를 많이 줄일 수 있기 때문에 매우 효과적이다.If there is little data to be generated in the tile, there is no time for prefetching, which leads to inevitable page crossing. However, even if such a case exists, the tiling-traversal scheme is very effective because the page crossing frequency can be reduced much more than the scan-line scheme.

다음으로 텍스처 캐쉬 접근 측면에서 보면, 스캔-라인 방식보다 타일링-트래버설 방식이 적용된 경우가 더 높은 성능을 얻을 수 있다.Next, in terms of the texture cache approach, higher performance is achieved when the tiling-traversal method is applied than the scan-line method.

즉, 상기 타일링-트래버설 방식은 텍스처의 지역성을 높여 캐쉬의 적중 실패율(miss ratio)을 더 낮춰주게 된다.That is, the tiling-traversal method increases the locality of the texture and lowers the miss ratio of the cache.

한 프래그먼트에서 요구되는 텍셀(texel) 중 많은 수가 인접한 프래그먼트에서 다시 재사용 되어질 수 있지만, 제한된 캐쉬의 공간으로 인해 캐쉬의 대치 전략에 따라 저장된 텍셀 데이터는 일정 시간 뒤에 캐쉬로부터 빠져나가게 된다.Many of the texels required in a fragment can be reused in adjacent fragments, but due to the limited cache space, texel data stored by the cache's replacement strategy is released from the cache after some time.

예를 들어, 인접한 두 개의 긴 스팬에서 각각 첫 번째 픽셀에서 같은 텍셀을 사용한다고 가정하자.For example, suppose we use the same texel at the first pixel in two adjacent long spans.

이 경우 스캔-라인 방식의 경우는 처리과정 중간에 캐쉬 안의 텍셀 정보가 빠져나갈 확률이 높고, 타일링-트래버설 방식은 해당 위치로 가는 시간이 상대적으로 짧아 적중 실패율이 낮아지게 되므로 텍스처 캐쉬의 성능 향상에 큰 도움이 되는 것이다.In this case, the scan-line method has a high probability of exiting the texel information in the cache in the middle of the processing process, and the tiling-traversal method has a relatively short time to go to the location, thereby reducing the hit failure rate, thereby improving the performance of the texture cache. It is a great help.

그러나, 핵심 연산인 반-평면 변 함수를 구현함에 있어서는 많은 비용과 고려를 필요로 하기 때문에 하드웨어로 구현하는데 많은 어려움이 있으며, 그에 따라 현재 타일링 트래버설 방식을 완전히 하드웨어로 구현한 사례를 찾아보기 힘들다.However, the implementation of the semi-plane side function, which is the core operation, requires a lot of cost and considerations, which makes it difficult to implement in hardware. Therefore, it is difficult to find a case where the current tiling traversal method is fully implemented in hardware. .

따라서 본 발명은 상기와 같은 문제점을 해결하기 위해 안출한 것으로서, 완전 하드웨어로 구현한 타일링 트래버설 방식의 주사 변환 유닛 및 방법을 제공하는데 그 목적이 있다.Accordingly, an object of the present invention is to provide a tiling traversal scan conversion unit and a method implemented in full hardware.

도 1 은 스캔-라인 방식과 타일링-트래버설 방식의 메모리 접근 형태를 보여주는 도면1 is a block diagram illustrating a memory access method of a scan-line method and a tiling-traversal method.

도 2 는 본 발명에 따른 타일링-트래버설 파이프라인의 흐름도2 is a flow chart of a tiling-traversal pipeline in accordance with the present invention.

도 3 은 본 발명에 따른 스탬프와 삼각형이 교차할 때 스탬프에 있는 네 개의 탐색점의 부호 상태를 나타내는 도면3 shows the sign state of the four search points in the stamp when the stamp and triangle intersect according to the present invention.

도 4(a)는 본 발명에 따른 삼각형의 세 변에 대한 스탬프의 탐색점 부호를 결정하는 방법을 나타낸 도면Figure 4 (a) is a view showing a method for determining the search point sign of the stamp for the three sides of the triangle according to the present invention

도 4(b)는 도 4(a)에 따른 연산을 수행하는 변 함수 유닛의 구조를 나타낸 도면4 (b) is a view showing the structure of the side function unit for performing the operation according to Figure 4 (a)

도 5 는 본 발명에 따른 삼각형이 들어왔을 때 분기가 발생되는 부분을 보여주는 도면5 is a view showing a portion in which a branch occurs when a triangle is entered according to the present invention;

도 6 은 본 발명에 따른 주사변환 유닛을 위한 삼각형 셋 업 유닛의 상세 도면6 is a detailed view of the triangular set up unit for the scan conversion unit according to the invention.

도 7 은 본 발명에 따른 주사변환 유닛을 위한 타일링-트래버설 유닛의 상세 도면7 is a detailed view of a tiling-traversal unit for a scan conversion unit according to the invention.

*도면의 주요부분에 대한 부호의 설명* Explanation of symbols for main parts of the drawings

100 : 전처리부 200 : 샘플포인트 계산부100: preprocessing unit 200: sample point calculation unit

300 : 세 변의 기울기 계산부 400 : 증분 값 계산부300: slope calculation unit of three sides 400: incremental value calculation unit

500 : 반-평면 변함수 계산부 600 : 반-평면 변 함수부500: half-plane side function calculation unit 600: half-plane side function unit

700 : 상태 점검부 800 : 최종 방향 결정 및 분기 예측부700: state check unit 800: final direction determination and branch prediction unit

900 : 셀렉트 커렉트 디렉션900: Select Select Direction

상기와 같은 목적을 달성하기 위한 본 발명에 따른 타일링 트래버설 방식의 주사변환 방법의 특징은 스탬프의 원점, 위(RT), 아래(RB), 오른쪽(LB) 위치에 따른 네 개의 탐색점의 부호를 검출하고, 상기 스탬프와 삼각형의 세 변에 대해 각각 반-평면 변 함수 연산을 수행하는 단계와, 상기 스탬프 네 개의 탐색점의 결정된부호를 두 개씩 조합하여 논리합 연산을 수행하고, 상기 논리합 연산한 결과를 논리곱 연산하여 결과 값이 0이면 스탬프가 이동 불가능한 방향인 것으로, 결과 값이 1이면 스탬프가 이동 가능한 방향인 것으로 정의하는 단계와, 상기 정의된 스탬프의 이동 가능한 모든 방향을 토대로 다음에 이동할 위치를 저장하는 저장 콘텍스트, 상기 저장 콘텍스트를 제어하는 최종 플래그, 그리고 타일 경계에 도달 유무 등을 조사하여 최종 방향을 선택하는 단계와, 다음으로 지정된 스탬프를 입력으로 상기 단계를 반복 수행하는 단계를 포함하여 이루어지는데 있다.Features of the scanning conversion method of the tiling traversal method according to the present invention for achieving the above object is the sign of four search points according to the origin, up (RT), down (RB), right (LB) position of the stamp Detecting a, and performing a semi-plane side function operation for each of the three sides of the stamp and the triangle, and combining the determined symbols of the four search points of the stamp two by two, and performs the OR operation If the result is a logical product and the result value is 0, defining the stamp is a non-movable direction; if the result value is 1, the stamp is a movable direction; and based on all the movable directions of the defined stamp, the next step is moved. The final direction is determined by examining the storage context storing the location, the final flag controlling the storage context, and whether the tile boundary has been reached. In step, an input given by the stamp, and then to be makin comprises the step of repeatedly performing the steps:

이때, 상기 최종 방향을 선택하는 단계는 스탬프의 이동 가능한 모든 방향 중 오른 방향에 제 1 우선순위로 정의하는 단계와, 상기 제 1 우선순위가 완료되거나 없으면 아래 방향에 제 2 우선순위로 정의하는 단계와, 상기 제 2 우선순위가 완료되거나 없으면 위 방향에 제 3 우선순위로 정의하는 단계로 이루어지는 것이 바람직하다.In this case, the selecting of the final direction may include defining a first priority in a right direction among all movable directions of a stamp, and defining a second priority in a downward direction when the first priority is completed or absent. And, if the second priority is not completed or not, defining the third priority in the upward direction.

상기와 같은 목적을 달성하기 위한 본 발명에 따른 타일링 트래버설 방식의 주사변환 유닛의 특징은 삼각형 셋업 유닛(triangle set-up unit), 타일링-트래버설 유닛(tiling traversal unit), 픽셀 처리 유닛(pixel processing unit)의 파이프라인으로 처리되는 주사 변환 유닛에 있어서, 상기 삼각형 셋업은 삼각형의 좌표, 깊이, 색, 투명도 그리고 텍스쳐 매핑을 위한 좌표등의 정보를 전처리해주는 전처리부와, 상기 전처리부에서 부동 포인트에서 고정 포인트로 바뀐 세 점에 해당되는 샘플 포인트의 좌표값인 정확한 픽셀을 찾아내는 샘플 포인트 계산부와, 상기 샘플 포인트 계산부에서 구해진 샘플 포인트의 좌표값을 연결하는 삼각형의 세 변의 기울기 값을 구하는 기울기 계산부와, 해당 픽셀의 깊이, 색, 투명도 그리고 텍스쳐 매칭을 위한 좌표들의 x축 기준의 증분값과 y축의 증분값을 계산하는 증분값 계산부와, 3개의 가산기만을 추가하여 다음 단계의 상기 타일링 트래버설 유닛에서 쓰여질 초기 반-평면 변 함수값을 계산하는 반-평면 변 함수 계산부를 포함하여 구성되는데 있다.A feature of the tiling traversal scanning conversion unit according to the present invention for achieving the above object is a triangle set-up unit, a tiling-traversal unit, a pixel processing unit (pixel) In a scan conversion unit processed by a pipeline of a processing unit, the triangle setup includes a preprocessor for preprocessing information such as coordinates of a triangle, depth, color, transparency, and coordinates for texture mapping, and a floating point in the preprocessor. A sample point calculator that finds an exact pixel that is a coordinate value of a sample point corresponding to three points changed into a fixed point in, and a slope that obtains a slope value of three sides of a triangle connecting the coordinate values of the sample point obtained by the sample point calculator. Increment of the calculation unit and the x-axis of coordinates for depth, color, transparency and texture matching of the pixel And an increment value calculator for calculating an increment value of the y-axis, and a semi-plane edge function calculator for adding an initial adder of only three adders to calculate an initial half-plane edge function value to be used in the tiling traversal unit of the next step. It is.

그리고 상기 증분값 계산부에서의 증분값 계산은And the increment value calculation in the increment value calculation unit

, ,

식을 이용하여 미리 계산하는데 다른 특징이 있다. There are other features to precalculate using equations.

상기와 같은 목적을 달성하기 위한 본 발명에 따른 타일링 트래버설 방식의 주사변환 유닛의 다른 특징은 상기 타일링-트래버설 유닛은 맨해튼 네이버 방식(manhattan neighbors)을 사용하여 스탬프 원점의 반-평면 변 함수 값을 미리 처리하고, 그 값에 해당 증분값을 더하여 나머지 세 점의 값을 구하도록 구성하는 반-평면 함수부와, 상기 반-평면 함수부에서 구해진 스탬프의 네 점의 결과를 가지고 현 스탬프가 이동 가능한 원시 방향들을 조사하고, 동시에 저장된 콘텍스트 내용과 타일 경계 및 방향에 대해서 점검하여 최종 이동방향을 결정할 때 사용되어질 각 플래그 비트를 조사하는 스탬프 상태 점검부와, 상기 스탬프 상태 점검부의 결과를 토대로 다음에 이동한 최종 방향을 결정하는 최종 방향 결정 및 분기 예측부를 포함하여 구성되는 있다.Another feature of the tiling traversal scanning conversion unit according to the present invention for achieving the above object is that the tiling-traversal unit uses Manhattan neighbors to produce a semi-planar side function value of the stamp origin. The pre-processing is performed, and the current stamp is moved with the result of the four points of the stamp obtained from the anti-planar function unit configured to obtain the values of the remaining three points by adding the corresponding increment value to the value. A stamp status checker that checks the possible primitive directions, examines the context contents and tile boundaries and directions stored at the same time, and examines each flag bit to be used when determining the final direction of movement; It is configured to include a final direction determination and branch prediction unit for determining the final direction moved.

그리고 상기 분기 예측부는 현재 타일 좌표와 현재 처리중인 스탬프 좌표를 카운터기를 이용하여 매번 조사하여 다음에 수행될 스탬프가 어느 것인지 미리 예측하고, 이 예측 결과로 버퍼에 저장되어 있는 다음에 수행될 그 스탬프 원점 값을 미리 반-평면 변 함수부로 보내는데 다른 특징이 있다.The branch predicting unit checks the current tile coordinates and the stamp coordinates currently being processed each time by using a counter to predict in advance which stamp is to be performed next, and the stamp origin stored in the buffer as a result of this prediction is to be performed. Another feature is that the values are sent to the half-plane side function in advance.

본 발명의 특징에 따른 작용은 반-평면 변 함수의 변형인 맨해튼 네이버 방식을 적용하여 필요 비용의 대부분을 절감시켰고, 분기 예측 기법(branch prediction)을 적용시켜 빈번하게 발생되는 분기를 최소로 하여 파이프라인의 지연현상을 효과적으로 감소시킬 수 있다.The operation according to the characteristics of the present invention is to reduce most of the cost required by applying the Manhattan Naver method, which is a variation of the semi-planar side function, and by applying branch prediction to minimize the number of frequently generated branches The delay of the line can be effectively reduced.

본 발명의 다른 목적, 특성 및 잇점들은 첨부한 도면을 참조한 실시예들의 상세한 설명을 통해 명백해질 것이다.Other objects, features and advantages of the present invention will become apparent from the following detailed description of embodiments taken in conjunction with the accompanying drawings.

본 발명에 따른 타일링 트래버설 방식의 주사변환 유닛의 바람직한 실시예에 대하여 첨부한 도면을 참조하여 설명하면 다음과 같다.A preferred embodiment of a tiling traversal scan conversion unit according to the present invention will be described with reference to the accompanying drawings.

설명에 앞서 본 명세서에서는 1픽셀 넓이 x 1픽셀 높이의 스탬프와 4픽셀 넓이 x 4픽셀 높이의 타일을 기준으로 삼는다.Prior to the description, the specification is based on a 1 pixel wide x 1 pixel high stamp and a 4 pixel wide x 4 pixel high tile.

도 2 는 본 발명에 따른 타일링-트래버설 파이프라인의 흐름도를 나타내고 있다.2 shows a flowchart of a tiling-traversal pipeline according to the present invention.

도 2와 같이, 먼저 스탬프 네 개의 탐색 점(원점, RT, RB, LB)과 삼각형의 세 변(E0, E1, E2)에 대해 각각 반-평면 변 함수 연산을 수행한다(10).As shown in FIG. 2, first, a semi-plane side function operation is performed on four search points (origin, RT, RB, LB) and three sides E0, E1, and E2 of a triangle (10).

이어, 상기 스탬프 네 개의 탐색점의 평가 결과를 토대로 현재 스탬프의 이동 가능한 모든 방향들을 구한다(20).Next, all the movable directions of the current stamp are obtained based on the evaluation results of the four search points of the stamp (20).

그리고 상기 구해진 결과를 토대로 최종 플래그, 저장 콘텍스트, 그리고 타일 경계에 도달 유무 등을 조사하여 최종 방향을 선택한다(30).The final direction is determined by checking the final flag, the storage context, and whether the tile boundary is reached based on the obtained result (30).

이때, 최종 방향의 선택에 있어서 다음과 같이 정의된 내용을 토대로 선택되어 진다.In this case, the final direction is selected based on the following definitions.

- 오른 방향이 기본방향으로 최우선시한다.-The right direction is the primary direction.

- 오른쪽 타일 경계에 도달한 경우라면, 오른 방향을 무시하고 위, 아래 방향으로 가능한지를 조사한다.If the right tile boundary is reached, ignore the right direction and check whether it is possible to move up and down.

이 경우 각각의 업(up), 다운(down) 플래그를 이용하여 업(up), 다운(down) 저장 콘텍스트가 비어 있는지를 파악한다.In this case, the respective up and down flags are used to determine whether the up and down storage contexts are empty.

이때, 상기 업, 다운 콘텍스트가 비어 있지 않으면, 여기에 저장되어 있는 위치의 스탬프를 다음에 처리할 스탬프로 지정한다. 이 경우 다운(down)을 우선으로 한다(40).At this time, if the up / down context is not empty, a stamp of a position stored therein is designated as a stamp to be processed next. In this case, down is given priority (40).

그리고 상기 업, 다운 콘텍스트가 비어 있다면 오른 타일 콘텍스트를 조사한다.If the up and down contexts are empty, the right tile context is examined.

그리고 상기 오른 타일 콘텍스트가 비어 있지 않으면, 여기에 저장되어 있는 해당 타일의 스탬프를 다음에 처리할 스탬프로 지정하여 처리하고, 만약 상기 오른 타일 콘텍스트가 비어 있다면 해당 삼각형의 처리가 모두 끝난 것으로 볼 수 있다.If the right tile context is not empty, the stamp of the tile stored therein is designated as a stamp to be processed next. If the right tile context is empty, the triangle processing may be considered as finished. .

여기서 콘텍스트(context)란 타일링-트래버설 방식에서 사용되는 특수 저장 공간으로, 현재 스탬프 위치에서 위 방향, 아래방향, 또는 다른 타일로 분기될 경우에 이동할 위치를 저장해 놓은 이정표 같은 것이다.The context is a special storage space used in the tiling-traversal method, and is a milestone that stores a position to be moved when branching from the current stamp position to an up direction, a down direction, or another tile.

따라서, 상기 업, 다운 및 오른 타일 콘텍스트들 중 하나라도 비어 있다면, 현재 처리중인 스탬프의 위(RT), 아래(RB), 오른쪽 방향(LB)의 스탬프 위치 값 중 현재 빈 콘텍스트에 해당되는 값에 저장한다. 또한, 다음에 처리될 스탬프가 현재 타일을 벗어나는지 아닌지 여부도 판단한다.Therefore, if any one of the up, down and right tile contexts is empty, the value corresponding to the current empty context among the stamp position values in the above (RT), below (RB), and right direction (LB) of the stamp currently being processed. Save it. It is also determined whether or not the stamp to be processed next leaves the current tile.

도면을 참조하여 좀더 상세히 설명하면 다음과 같다.Referring to the drawings in more detail as follows.

도 3 은 본 발명에 따른 스탬프와 삼각형이 교차할 때 스탬프에 있는 네 개의 탐색점의 부호 상태를 나타내는 도면이다. 그리고 도 4(a)는 본 발명에 따른 삼각형의 세 변에 대한 스탬프의 탐색점 부호를 결정하는 방법을 나타낸 도면이고, 도 4(b)는 도 4(a)에 따른 연산을 수행하는 변 함수 유닛의 구조를 나타낸 도면이다.3 is a diagram illustrating the sign state of four search points in a stamp when the stamp and the triangle intersect according to the present invention. 4 (a) is a diagram illustrating a method of determining a search point sign of a stamp for three sides of a triangle according to the present invention, and FIG. 4 (b) is a side function for performing an operation according to FIG. 4 (a). It is a figure which shows the structure of a unit.

도 3과 같이, 삼각형의 세 변에 대한 스탬프의 탐색점(원점, RT, RB, LB)의 부호 상태를 검출하고, 도 4(a)와 같이, 한 스탬프와 삼각형의 세 변에 대한 반-평면 변 함수 연산을 통해 현 스탬프의 네 개의 탐색점들에 대한 부호를 구한다.As shown in FIG. 3, the sign state of the search point (origin, RT, RB, LB) of the stamp for the three sides of the triangle is detected, and as shown in FIG. Plane side function operation is used to find the sign of the four search points of the current stamp.

이때, 각 탐색점의 최종 부호의 결정은 세 개의 변에 대한 결과를 논리곱 연산(AND) 시켜 얻는다.At this time, the final sign of each search point is obtained by performing an AND operation on the results of three sides.

그리고 도 4(b)와 같이, 결정된 네 개의 탐색점의 부호를 토대로 표 1에서와 같이 각 스탬프의 위(RT), 아래(RB), 오른쪽(LB) 위치에 대한 방향 플래그의 유효 여부를 결정한다.As shown in FIG. 4 (b), the validity of the direction flags for the up (RT), down (RB) and right (LB) positions of each stamp is determined based on the symbols of the four search points. do.

이 때 각 스탬프 위치에 해당하는 탐색점들을 논리합 연산(OR) 시켜 그 결과 값이 0이 되면 그 방향으로는 갈 수가 없음을 의미하고 1이면 해당 방향이 유효함을 나타낸다.In this case, the search points corresponding to each stamp position are ORed, and when the result is 0, it means that the direction cannot be reached. If 1, the direction is valid.

이와 같이, 최종 방향이 결정되면, 다음으로 지정된 스탬프를 파이프라인 입력받아 상기 작업을 반복 수행한다.In this way, when the final direction is determined, the pipeline receives the next designated stamp and repeats the above operation.

이와 같은 타일링-트래버설 방식의 파이프라인 처리 과정에 맨하튼 네이버 방식을 적용하는 경우 전체적인 동작을 설명하면 다음과 같다.When the Manhattan Naver method is applied to the tiling-traversal pipeline processing process, the overall operation will be described as follows.

먼저, 스탬프의 4개의 탐색점(원점, RT, RB, LB)이 삼각형의 안에 있는지 바깥에 있는지를 알기 위해서는 반-평면 변 함수를 수행해야한다.First, to find out whether the four search points of the stamp (origin, RT, RB, LB) are inside or outside the triangle, we need to perform a semi-plane side function.

즉, 최초의 스탬프의 첫 탐색점인 원점(ORIGIN)에 대한 계산 부분은 셋 업 부분에서 계산한다. 이 스탬프의 RT와 LB는 맨해튼 네이버 방식에 따라 원점값에각각 dy, dx를 더해주어 구해주고, RB의 경우에는 dx와 dy를 모두 더해줌으로 4개의 탐색점에 대한 반-평면 변 함수 값을 결정한다.That is, the calculation part for the origin point (ORIGIN), which is the first search point of the first stamp, is calculated in the setup part. The RT and LB of this stamp are obtained by adding dy and dx to the origin values according to the Manhattan Naver method, and in the case of RB, by adding both dx and dy, the semi-plane side function values for four search points are obtained. Decide

이어, 상기 탐색점에 대한 결정이 끝나면, 스탬프의 초기 방향을 구하게 되는데, 이때 저장 콘텍스트의 플래그를 참조하고, 빈 콘텍스트에 해당되는 값을 저장한다.Subsequently, when the determination of the search point is completed, an initial direction of the stamp is obtained. In this case, the flag of the storage context is referred to and a value corresponding to the empty context is stored.

동시에, 타일 경계에 대한 조사를 하는데, 제안 유닛에서는 오른쪽과 아래쪽 타일만 고려한다. 이 때 각 타일 경계에 대해서 타일의 열(row) 좌표와 RB의 y좌표를 비교하고, 타일의 행(column) 좌표와 RB의 x좌표를 비교함으로써 결정한다.At the same time, the tile boundary is examined and the proposed unit only considers the right and bottom tiles. At this time, it is determined by comparing the row coordinate of the tile with the y coordinate of the RB for each tile boundary, and comparing the column coordinate of the tile with the x coordinate of the RB.

또한, 타일 내에서의 스탬프의 이동을 제어하기 위한 업/다운(up/down) 플래그를 셋팅하게 된다.In addition, an up / down flag for controlling the movement of the stamp in the tile is set.

이렇게 결정된 각각의 플래그들은 통합적으로 평가되어 최종의 이동 방향이 결정된다.Each flag thus determined is evaluated integrally to determine the final direction of movement.

이때 상기 각각의 플래그 비트들에 대한 패턴들을 테이블로 정의해놓고 이에 따라 수행되도록 한다. 그리고 콘텍스트 버퍼에 저장될 해당 위치의 값들은 현재 가지고 있는 콘텍스트 값과 기울기값들을 각각의 위치에 맞는 기울기 값에 더해 저장하게 된다. 또한 각각의 저장 콘텍스트의 상태를 표시하는 플래그는 유효한 값을 저장하게 되면 1로 설정하고 저장된 값이 빠져나가면 0으로 설정한다.At this time, the patterns for the respective flag bits are defined in a table and performed accordingly. The values of the corresponding positions to be stored in the context buffer are stored by adding the current context values and inclination values to the respective inclination values. In addition, the flag indicating the state of each storage context is set to 1 when a valid value is stored and to 0 when the stored value is exited.

이어 다음 처리될 위치의 저장 콘텍스트의 값은 파이프라인 입력으로 들어가게 된다.The value of the storage context at the location to be processed is then entered into the pipeline input.

이때, 맨해튼 네이버 방식을 적용했기 때문에, 한 삼각형의 트래버설이 완전히 끝나기 전까지는 이전에 계산되어 파이프라인으로 입력되는 현재 스탬프 원점의 값에 dx, dy를 더하여 RB, LB, RT 값을 구해준다.At this time, since the Manhattan Naver method is applied, RB, LB, and RT values are obtained by adding dx and dy to the value of the current stamp origin, which is calculated and input into the pipeline until the traversal of one triangle is completely completed.

또한 타일링-트래버설 유닛에서는 일반적으로 스탬프의 이동을 담당하고 있는데, 일반 트래버설 알고리즘이 적용된 경우에는 스탬프 이동상의 분기로 인한 파이프라인 지연이 많이 발생하여 사이클 낭비가 심하게 되어 전체적으로 성능에 악영향을 미친다.In addition, the tiling-traversal unit is generally responsible for the movement of the stamp. When the general traversal algorithm is applied, the pipeline delay caused by the branching of the stamp movement occurs a lot, which wastes cycles and adversely affects the overall performance.

따라서, 다음에 방문해야 하는 스탬프, 특히 위, 아래, 오른 타일에 해당되는 스탬프의 처리 순서를 미리 예측하여 해당 스탬프의 값을 파이프라인으로 입력시켜 파이프라인 지연을 최소화하여 파이프라인 효율을 극대화하여 성능을 향상시킨다.Therefore, it predicts the processing order of the stamps that need to be visited next time, especially the top, bottom, and right tiles in advance, and inputs the values of the stamps into the pipeline to minimize pipeline delays to maximize pipeline efficiency. To improve.

일반적으로 타일링-트래버설 방식의 파이프라인에서 한 스탬프의 처리가 끝나게 되면, 그 스탬프는 프래그먼트 생성 과정으로 넘어가고, 이와 동시에 다음 스탬프가 파이프라인 입력으로 들어오게 된다.In general, when a stamp is processed in a tiling-traversal pipeline, the stamp goes to the fragment generation process, and at the same time, the next stamp enters the pipeline input.

여기에서 주목할 점은 다음에 와야 하는 스탬프의 위치가 결정되는 시점이 해당 스탬프가 프래그먼트 생성 과정으로 넘어갈 때라는 점이다.It should be noted that the next time the position of the stamp to be determined is determined, the stamp is passed to the fragment generation process.

따라서, 오른쪽으로 진행하는 일반적인 구조에서 타일 경계나 삼각형의 경계에 부딪치게 되어 분기가 발생되면, 현재 스탬프가 파이프라인 단을 전부 통과할 때까지는 파이프라인이 멈춰야 한다는 문제점이 발생한다.Therefore, in the general structure that proceeds to the right, when hitting the boundary of the tile or triangle and the branching occurs, there is a problem that the pipeline should be stopped until the current stamp passes through the pipeline stage.

이 점은 파이프라인으로 구성된 전체 구조의 성능에 치명적인 요소로 작용될 수 있다. 본 발명에서 Quake 3 벤치마크에서 실험해 보니 전체의 약 30% 정도에서분기가 발생함을 알 수 있었다.This can be critical to the performance of the entire structure of the pipeline. Experiments in the Quake 3 benchmark in the present invention showed that the branching occurs in about 30% of the total.

이와 같이 타일링-트래버설 방식에서 파이프라인 지연이 발생하는 경우는 우선 크게 두 가지로 나눌 수 있는데 그 첫 번째는 스탬프가 타일 경계에 부딪치는 경우이고, 두 번째는 스탬프가 삼각형의 변 경계에 걸리는 경우이다.In this case, there are two main types of pipeline delay in tiling-traversal. The first is when the stamp hits the tile boundary, and the second is when the stamp is caught on the edge of the triangle. to be.

먼저, 첫 번째인 스탬프가 타일 경계에 부딪치는 경우는 스탬프가 이동할 때 타일 경계에 부딪쳐서 생기는 파이프라인 지연이다.First, the first stamp hits a tile boundary, which is a pipeline delay caused by hitting the tile boundary as the stamp moves.

즉, 스탬프의 기본 이동방향은 오른쪽인데 타일 경계에 부딪치게 되면 현재 스탬프가 전부 처리되어야 다음에 와야 할 스탬프의 위치를 알 수 있기 때문에, 2단이면 하나, 3단이면 2개의 파이프라인 지연이 발생하게 된다.In other words, the default movement direction of the stamp is on the right side, but if it hits the tile boundary, the current stamp must be fully processed to know the position of the next stamp. do.

다음으로 두 번째인 스탬프가 삼각형의 경계에 걸리는 경우는 삼각형의 변에 스탬프가 걸치는 경우에 발생하는 파이프라인 지연으로, 타일 경계에 닿지 않아도 삼각형의 변에 닿으면 분기가 발생하게 된다.If the second stamp is on the edge of the triangle, the pipeline delay occurs when the edge of the triangle is on the edge of the triangle.

또한, 상기 두 경우가 모두 발생되는 경우로 스탬프가 타일 경계에 닿으면서 삼각형의 변과도 마주치는 경우이다. 특히 타일의 네 귀퉁이에 위치해 있는 스탬프의 경우는 파이프라인 지연이 발생하는 것을 피하기 어렵다.In addition, both cases occur when the stamp touches a tile boundary and encounters a triangle side. Especially for stamps located at the four corners of the tile, it is difficult to avoid pipeline delays.

도 5 는 삼각형이 들어왔을 때 분기가 발생되는 부분을 보여주는 도면으로, 도 5에서 보면, 콘텍스트를 불러오는 부분에서 분기가 일어남을 알 수 있다.FIG. 5 is a diagram illustrating a portion where a branch occurs when a triangle is entered. Referring to FIG. 5, it can be seen that a branch occurs at a part of bringing up a context.

따라서, 분기 예측 기법을 사용하여 다음 스탬프 위치를 미리 파악하여 타일링-트래버설 방식의 파이프라인으로 입력시켜 분기의 발생으로 인해 파이프라인 단이 비게 되는 것, 즉 파이프라인이 멈추는 것을 최소화할 수 있다.Therefore, the branch prediction technique can be used to determine the next stamp position in advance and input it into the tiling-traversal pipeline, thereby minimizing the pipeline stage being empty due to the occurrence of the branch, that is, stopping the pipeline.

현재 타일 트래버설 방식의 저장 콘텍스트에는 다음에 처리될 스탬프 원점의 정보가 저장되어 있다. 따라서 상기 문제 해결의 핵심은 저장되어 있는 콘텍스트 중에 어떤 콘텍스트가 현재 콘텍스트 바로 다음에 파이프라인 입력되느냐 이다.In the current tile traversal storage context, the stamp origin information to be processed next is stored. Thus, the key to solving the problem is which of the stored contexts is pipelined immediately after the current context.

이때 스탬프의 기본 이동방향은 오른쪽이고, 타일링-트래버설 유닛은 연속적으로 오른쪽에 있는 정보를 파이프라인 입력으로 가져오는 것을 적용하여야 한다.At this time, the basic movement direction of the stamp is the right side, and the tiling-traversal unit should continuously apply the information on the right side to the pipeline input.

도 5에서 작은 사각형은 하나의 스탬프를 의미하고, 삼각형 내부의 숫자는 스탬프의 이동순서이다.In FIG. 5, the small square means one stamp, and the number inside the triangle indicates the movement order of the stamp.

이와 같은 도 5를 참조하여 분기 예측 기법에 대해 실시예를 상세히 설명하면 다음과 같다.The embodiment of the branch prediction scheme will be described in detail with reference to FIG. 5 as follows.

먼저, 10번 스탬프가 변 함수 연산에 들어가서 처리되고 다음 단계로 넘어갈 때, 11번은 바로 변 함수 연산 단계로 들어오게 된다. 11번 스탬프가 변 함수 연산 단계로 들어가면, 40번이 들어오게 되는데 이는 올바른 값이 아니기 때문에 버려지게 된다.First, when stamp 10 enters the side function operation and is processed and goes to the next step, 11 enters the side function operation step. When stamp 11 enters the side function calculation step, 40 is entered, which is discarded because it is not a valid value.

그리고 11번 스탬프에 대한 파이프라인 처리가 끝난 후 12번 스탬프를 불러들이게 된다.After the pipeline process for stamp 11 is finished, stamp 12 is imported.

이 경우 트래버설 처리가 3 사이클(cycle) 걸리는 경우 2사이클의 사이클이 낭비되므로, 10번 스탬프가 변 연산 함수에서 처리될 때, 12번 스탬프를 대기시킨다.In this case, if the traversal process takes 3 cycles, 2 cycles are wasted, so when the 10th stamp is processed in the side calculation function, the 12th stamp is waited.

즉, 11번 스탬프가 처리된 후 바로 12번 스탬프가 파이프라인 입력단으로 들어올 수 있도록 하기 위함인데, 이는 11번 스탬프가 변 함수 연산을 마치고 다음단으로 넘어가는 것과 동시에 대기하고 있던 12번 콘텍스트를 파이프라인으로 입력시켜줘야 한다.In other words, immediately after stamp 11 is processed, stamp 12 can be entered into the pipeline input stage.This means that pipe 11 will be queued to context 12, which is waiting for stamp 11 to finish the transition function and move on to the next stage. It must be entered as a line.

이와 같이 동작이 시작되기 전에 먼저 현재 스탬프가 타일 내에서 어느 위치에 있는지를 파악해야 한다.As such, before starting the action, it is necessary to know where the current stamp is in the tile.

현재 스탬프의 위치를 파악하기 위해서는 현재 스탬프의 원점의 좌표와 현재 타일의 좌표를 비교하게 된다. 이때, 좌표값을 쉽게 비교할 수 있다.To determine the location of the current stamp, the coordinates of the origin of the current stamp and the coordinates of the current tile are compared. At this time, the coordinate values can be easily compared.

효과적으로 하드웨어 구현을 하기 위해서 타일의 크기를 2mx 2n(m,n은 정수)의 크기로 나눈다.For effective hardware implementation, divide the tile size by 2 m x 2 n (where m and n are integers).

그리고 Up_position, Down_position, Right_position의 플래그와, 업/다운(up/down) 플래그, 및 저장 콘텍스트의 유효 플래그 값을 가지고 비교를 하게 된다.The up_position, down_position, and right_position flags are compared with the up / down flags and valid flag values of the storage context.

도 6과 도 7에서 타일링-트래버설 방식의 파이프라인된 주사변환 유닛을 보여주는 도면으로, 도 6 은 본 발명에 따른 주사변환 유닛을 위한 삼각형 셋 업 유닛의 상세 도면을 나타내고 있으며, 도 7 은 본 발명에 따른 주사변환 유닛을 위한 타일링-트래버설 유닛의 상세 도면을 나타내고 있다.6 and 7 show a tiling-traversal pipelined scan conversion unit, FIG. 6 shows a detailed view of a triangular set up unit for a scan conversion unit according to the invention, and FIG. A detailed view of the tiling-traversal unit for the scan conversion unit according to the invention is shown.

일반적인 반-평면 변 함수를 하드웨어로 구현하는 경우는 도 4(b)의 변 함수 유닛이 총 12개가 들어가게 되어, 이 부분에만 24개의 승산기와 72개의 가산기가 필요하게 된다.In the case of implementing a general half-plane side function in hardware, a total of 12 side function units of FIG. 4 (b) are required, and only 24 multipliers and 72 adders are required for this part.

따라서, 이 부분에서 많은 하드웨어 로직 (hardware logic)들을 요구함에 따라 하드웨어로 구현하는데 필요한 비용이 매우 커지게 되어 문제가 된다.Therefore, this requires a lot of hardware logic (hardware logic) is a problem that the cost required to implement in hardware becomes very large.

이를 도 7과 같이 맨해튼 네이버 방식을 적용하여 구현하였으며, 더욱 효과적으로 비용을 절감하기 위해서 도 6과 같이 삼각형 셋 업 단계와도 고려하였다.This is implemented by applying the Manhattan Naver method as shown in Figure 7, and in order to reduce the cost more effectively, the triangle setup step as shown in Figure 6 was also considered.

본 발명에 따른 구조에서는 총 15개의 가산기만을 추가하여 반-평면 변 함수를 구현하였다.In the structure according to the present invention, a total of 15 adders were added to implement the half-plane side function.

도 6 은 일반적 삼각형 셋 업 유닛에서 3개의 가산기를 추가하여 최초의 반-평면 변 함수 연산을 수행하도록 한 것이다.6 adds three adders in a general triangular set up unit to perform the first half-plane side function operation.

도 6을 보면, 삼각형 셋업부는 각각의 연산 특징에 따라 전처리부(100), 샘플포인트 계산부(200), 세변의 기울기 계산부(300), 삼각형 모든 정보에 대한 증분 값 계산부(400), 그리고 삼각형 당 최초 반-평면 변함수 계산부(500)로 나눌 수 있다.Referring to FIG. 6, the triangle set-up unit includes a preprocessor 100, a sample point calculator 200, a three-sided slope calculator 300, an incremental value calculator 400 for all triangle information, and the like. And it can be divided into the first half-plane variation function calculation unit 500 per triangle.

상기 삼각형의 셋업 전처리부(100)는 삼각형의 모든 정보들, 즉, 좌표(x,y), 깊이(z), 색(RGB), 투명도(α), 그리고 텍스쳐 매핑을 위한 좌표들의 전처리 해주는 부분이다.The triangle setup preprocessor 100 preprocesses all information of the triangle, that is, coordinates (x, y), depth (z), color (RGB), transparency (α), and coordinates for texture mapping. to be.

Compare unit에서는 기하학 처리 단에서 입력되는 삼각형의 세 점 V0, V1, V2를 가지고, 각각 y좌표를 기준으로 정렬시켜 가장 위쪽에 있는 점은 vMax, 중간점을 vMid, 가장 아래쪽에 위치한 점은 vMin으로 명명한다.Compare unit has three points, V0, V1, and V2, which are input from the geometry processing stage.They are aligned based on y-coordinates so that the uppermost point is vMax, the middle point is vMid, and the lowest point is vMin. Name it.

Float to Fixed에서는 부동 포인트(floating point)값인 세 점의 좌표값을 고정 포인트(Fixed point)로 바꾸는 작업을 한다. 왜냐하면, 부동 연산을 수행하는 기하학 처리부분과 달리, 래스터라이제이션 부분에서는 정수 연산이나, 고정 연산만을 수행하기 때문이다.In Float to Fixed, the coordinates of three points, which are floating point values, are converted into fixed points. This is because, unlike the geometry processing portion that performs floating operations, the rasterization portion performs only integer operations or fixed operations.

그리고 Calculate deltas에서는 삼각형의 각변의 증분값 즉, eMax.dx = vMax.dx-vMin.dx의 값을 구하는 부분으로 이후에 쓰여지는 모든 변의 증분값을 미리 구해놓는다.In Calculate deltas, the increment value of each side of the triangle, that is, the value of eMax.dx = vMax.dx-vMin.dx, is obtained.

상기 삼각형 세 점 각각의 샘플 포인트 계산부(200)에서는 부동 포인트에서 고정 포인트로 바뀐 세 점에 해당되는 정확한 픽셀을 찾아내기 위한 작업을 한다. 즉, 입력된 삼각형의 세 정점의 y좌표값을 먼저 라운딩 (rounding)하고, 이 값을 가지고 조정(adjust)값을 구해 세 정점의 x좌표값에 더해주면, 정점의 샘플 포인트의 좌표값이 구해진다. 샘플포인트는 이후 연산부터에서 고정 포인트로 바뀐 정점들 대신 사용된다.The sample point calculator 200 of each of the three triangle points performs an operation for finding an accurate pixel corresponding to three points changed from a floating point to a fixed point. That is, the y coordinate value of the three vertices of the input triangle is rounded first, and then the adjusted value is obtained using this value and added to the x coordinate values of the three vertices. Become. The sample point is used instead of the vertices that are changed to fixed points in subsequent operations.

상기 세변의 기울기 계산부(300)는 삼각형의 세 변의 기울기 값 (Δx/Δy)을 구하는 부분이다. 나눗셈 연산을 수행하지 않고, 역수 검색 테이블 (reciprocal LUT: Look Up Table)을 이용해서 연산을 수행한다. 왜냐하면, 나눗셈 연산 자체가 상당한 대기시간(latency)을 필요로 하기 때문에, 역수 검색 테이블을 사용하여 해당 부분을 참조해주고, 그 값을 곱해주는 방식으로 대기시간(latency)을 줄일 수 있다.The inclination calculator 300 of three sides is a part for obtaining inclination values (Δx / Δy) of three sides of a triangle. Instead of performing a division operation, the operation is performed using a reciprocal LUT (Look Up Table). Because the division operation itself requires a considerable latency, the latency can be reduced by referencing the corresponding portion using a reciprocal lookup table and multiplying the value.

또한 레스터라이제이션 자체의 크기를 줄여주는 효과도 있다. 이런 이유로 많은 다른 경우, 나눗셈 연산 대신 역수 검색 테이블을 사용하고 있다.It also has the effect of reducing the size of the rasterization itself. For this reason, in many other cases, we use reciprocal lookup tables instead of division operations.

상기 삼각형 정보의 증분 값 계산부(400)는 깊이(z), 색(RGB), 투명도(α), 그리고 텍스쳐 매핑을 위한 좌표들의 x축 기준의 증분값과 y축 기준의 증분값을 계산한다. 증분값은 편미분 값을 구하는 계산으로, 그 식은 다음과 같다.The increment value calculator 400 of the triangular information calculates an increment value based on the x axis and an increment value based on the y axis of coordinates for depth z, color RGB, transparency α, and texture mapping. . Incremental values are calculations for partial derivatives. The equation is:

, ,

. .

여기에서 C는 각 변수들을 총칭한다.Here C stands for each variable.

각 정보들은 모두 같은 역수 값을 가지기 때문에 이는 미리 계산할 수 있다. 공통 값을 미리 계산해 줌으로써 하드웨어 구현시 증분 값 계산에서 발생할 수 있는 오버헤드를 충분히 줄일 수 있다.Since each piece of information has the same inverse, it can be calculated in advance. By precomputing common values, the hardware implementation can reduce the overhead incurred in incremental calculations.

여기서는 이 역수 값을 'oneOverarea'라 하여 미리 계산해준다. 역시 나눗셈 연산을 해줘야 하기 때문에, 역수 검색 테이블을 이용하고 있다.In this case, the inverse value is calculated in advance as 'oneOverarea'. We also need a division operation, so we are using an inverse lookup table.

그리고 상기 최초 반-평면 변함수 계산부(500)는 타일링-트래버설 방식의 주사변환 유닛의 경우에 있는 것으로, 이후 단계인 타일링 -트래버설 유닛에서 쓰여질 초기 반-평면 변 함수값을 계산하는 부분이다.The first half-plane variation function 500 is in the case of a tiling-traversal scan conversion unit, and calculates an initial half-plane side function value to be written in a later tiling-traversal unit. to be.

반-평면 변 함수 계산부(500)는 셋업 유닛의 oneOverarea 계산 부분과 유사하다.The half-plane side function calculation unit 500 is similar to the oneOverarea calculation portion of the setup unit.

그리고, 본 삼각형 셋 업 유닛이 3사이클의 처리능력을 가지고 있는 유닛이기 때문에, ‘oneOverarea‘ 부분이 항상 사용되어지는 것이 아니다.And since this triangle setup unit has 3 cycles of processing capacity, the 'oneOverarea' part is not always used.

따라서 본 유닛에서는 추가되는 하드웨어(특히 곱셈기들)를 절약하기 위해서, ‘oneOverarea‘가 연산을 수행하지 않는 동안 삼각형 당 최초의 반-평면 함수값을 계산하게 하고 있다.Therefore, in order to save additional hardware (especially multipliers), this unit allows oneOverarea to compute the first half-plane function value per triangle while not performing any operation.

또한 본 발명에서 제안하는 구조에서는 맨해튼 네이버 방식을 채택하여 15개의 가산기만을 추가하여 반-평면 변 함수를 구현하여 보다 효과적으로 하드웨어를 절감하였다.In addition, the structure proposed in the present invention adopts the Manhattan Naver method and adds only 15 adders to implement a half-plane side function, thereby more effectively reducing hardware.

그리고 도 7과 같이, 타일링-트래버설부는 각각의 연산 특징에 따라, 반-평면 변 함수부(600), 현 스탬프의 상태 점검부(700), 최종 방향 결정 및 분기 예측부(800)로 나눌 수 있다.As shown in FIG. 7, the tiling-traversal unit may be divided into a semi-plane side function unit 600, a state check unit 700 of the current stamp, a final direction determination unit, and a branch prediction unit 800 according to each operation characteristic. Can be.

상기 반-평면 변 함수값은 삼각형 셋 업 부에 3개의 가산기만을 추가하여 구하고 있다.The half-plane side function value is obtained by adding only three adders to the triangle setup part.

상기 현재 스탬프의 상태를 점검부(700)는 최종 이동방향을 결정할 때 사용되어질 각 플래그 비트를 조사하는 부분이다.The checking unit 700 checks the state of the current stamp and checks each flag bit to be used when determining the final moving direction.

우선적으로, 반-평면 변 함수부(600)에서 구해진 스탬프의 네 점의 결과를 가지고 현재 스탬프가 이동 가능한 원시 방향들 (raw direction)을 조사한다. 그리고 동시에 저장된 콘텍스트 내용과 타일경계 및 방향에 대해서도 점검을 한다.First, the raw direction in which the current stamp can move is examined with the result of the four points of the stamp obtained in the semi-plane side function unit 600. At the same time, the contents of the saved context, tile boundaries and orientations are checked.

최종 방향 결정 및 분기 예측부(800)는 스탬프 점검부의 결과를 토대로, 다음에 이동할 최종 방향을 결정하는 부분이다.The final direction determination and branch prediction unit 800 is a part for determining the final direction to move next, based on the result of the stamp checker.

결정된 다음 스탬프의 원점에 해당되는 모든 정보 값들(좌표(x,y), 깊이(z), 색(RGB), 투명도(α), 그리고 텍스쳐 매핑 좌표들)도 구해줘야 한다.All information values (coordinates (x, y), depth (z), color (RGB), transparency (α), and texture mapping coordinates) corresponding to the origin of the next stamp determined must also be obtained.

이를 위해, 현재 위치의 정보에 해당 증분값들을 더해주고, 그 값을 버퍼에 저장해 놓는다.To do this, we add the corresponding increments to the information at the current location and store the values in the buffer.

분기 예측부(800)에서는 파이프라인 지연이 최소가 되도록, 버퍼에 저장되어있는 다음 스탬프 값을 미리 반-평면 변 함수부(600)로 보내 주고있다.The branch predictor 800 transmits the next stamp value stored in the buffer to the anti-plane side function unit 600 in advance so that the pipeline delay is minimized.

따라서 분기 예측부(800)는 현재 타일 좌표와 현재 처리 중인 스탬프 좌표를 카운터기(counter)를 이용하여 매번 조사하여, 다음에 수행될 스탬프가 어느 것인지 미리 예측하고 있다. 그리고 해당되는 스탬프의 좌표값들을 미리 반-평면 변 함수부(600)로 보내주어 한 삼각형의 트래버설 작업이 끝날 때까지 타일링-트래버설 파이프라인이 계속 이뤄지게 한다.Accordingly, the branch predictor 800 examines the current tile coordinates and the stamp coordinates currently being processed each time by using a counter, and predicts in advance which stamp is to be performed next. And the coordinate values of the corresponding stamp is sent in advance to the semi-plane side function unit 600 to continue the tiling-traversal pipeline until the triangle traversal work is completed.

그리고 셀렉트 커렉트 디렉션(select correct direction (prediction))(900)은 타일링-트래버설 유닛에서 최종 방향을 미리 예측하여 파이프라인 지연이 막아주는 분기 예측부(800)와 그 주변 부분들과의 관계를 보여준다.In addition, the select correct direction (prediction) 900 predicts the final direction in the tiling-traversal unit in advance so that the relationship between the branch predictor 800 and the neighboring parts of the branch predictor 800 which prevents the pipeline delay is prevented. Shows.

이와 같이 분기 예측부(800)가 포함된 타일링-트래버설 유닛을 구현하여 파이프라인 지연 현상을 효과적으로 줄여주었다.As such, the tiling-traversal unit including the branch prediction unit 800 is implemented to effectively reduce the pipeline delay.

이상에서 설명한 바와 같은 본 발명에 따른 타일링 트래버설 방식의 주사변환 유닛은 반-평면 변 함수의 변형인 맨해튼 네이버 방식을 적용하여 필요 비용의 대부분을 절감시켰고, 분기 예측 기법을 적용시켜 빈번하게 발생되는 분기를 최소로 하여 파이프라인의 지연현상을 70%이상 효과적으로 감소시켰다.As described above, the tiling traversal scan conversion unit according to the present invention applies the Manhattan Naver method, which is a variation of the anti-planar side function, to reduce most of the required cost, and is frequently generated by applying the branch prediction technique. Minimizing the branch effectively reduces pipeline latency by more than 70%.

이상 설명한 내용을 통해 당업자라면 본 발명의 기술 사상을 이탈하지 아니하는 범위에서 다양한 변경 및 수정이 가능함을 알 수 있을 것이다.Those skilled in the art will appreciate that various changes and modifications can be made without departing from the spirit of the present invention.

따라서, 본 발명의 기술적 범위는 실시예에 기재된 내용으로 한정되는 것이 아니라 특허 청구의 범위에 의하여 정해져야 한다.Therefore, the technical scope of the present invention should not be limited to the contents described in the embodiments, but should be defined by the claims.

Claims (6)

스탬프의 원점, 위(RT), 아래(RB), 오른쪽(LB) 위치에 따른 네 개의 탐색점의 부호를 검출하고, 상기 스탬프와 삼각형의 세 변에 대해 각각 반-평면 변 함수 연산을 수행하는 단계와,Detects the sign of four search points according to the origin, up (RT), down (RB) and right (LB) positions of the stamp, and performs anti-plane side functions on the three sides of the stamp and triangle, respectively. Steps, 상기 스탬프 네 개의 탐색점의 결정된 부호를 두 개씩 조합하여 논리합 연산을 수행하고, 상기 논리합 연산한 결과를 논리곱 연산하여 결과 값이 0이면 스탬프가 이동 불가능한 방향인 것으로, 결과 값이 1이면 스탬프가 이동 가능한 방향인 것으로 정의하는 단계와,Performs an OR operation by combining the determined signs of the four search points of the stamp two by two, and ORs the result of the OR operation, and if the result value is 0, the stamp is in a non-movable direction. Defining it to be a movable direction, 상기 정의된 스탬프의 이동 가능한 모든 방향을 토대로 다음에 이동할 위치를 저장하는 저장 콘텍스트, 상기 저장 콘텍스트를 제어하는 최종 플래그, 그리고 타일 경계에 도달 유무 등을 조사하여 최종 방향을 선택하는 단계와,Selecting a final direction by investigating a storage context storing a position to be moved next, a final flag for controlling the storage context, whether a tile boundary is reached, and the like based on all movable directions of the defined stamp; 다음으로 지정된 스탬프를 입력으로 상기 단계를 반복 수행하는 단계를 포함하여 이루어지는 것을 특징으로 하는 타일링 트래버설 방식의 주사변환 유닛.And repeating the above steps with the input of the designated stamp. 제 1 항에 있어서, 상기 최종 방향을 선택하는 단계는The method of claim 1, wherein selecting the final direction 스탬프의 이동 가능한 모든 방향 중 오른 방향에 제 1 우선순위로 정의하는 단계와,Defining a first priority in a right direction among all movable directions of the stamp; 상기 제 1 우선순위가 완료되거나 없으면 아래 방향에 제 2 우선순위로 정의하는 단계와,Defining a second priority in a downward direction when the first priority is completed or absent; 상기 제 2 우선순위가 완료되거나 없으면 위 방향에 제 3 우선순위로 정의하는 단계로 이루어지는 것을 특징으로 하는 타일링 트래버설 방식의 주사변환 유닛.And a step of defining a third priority in the upward direction if the second priority is not completed or absent. 삼각형 셋업 유닛(triangle set-up unit), 타일링-트래버설 유닛(tiling- traversal unit), 픽셀 처리 유닛(pixel processing unit)의 파이프라인으로 처리되는 주사 변환 유닛에 있어서,In the scan conversion unit processed by the pipeline of a triangle set-up unit, a tiling-traversal unit, and a pixel processing unit, 상기 삼각형 셋업은 삼각형의 좌표, 깊이, 색, 투명도 그리고 텍스쳐 매핑을 위한 좌표등의 정보를 전처리해주는 전처리부와,The triangle setup includes a preprocessor for preprocessing information such as coordinates, depth, color, transparency, and coordinates for texture mapping of the triangle, 상기 전처리부에서 부동 포인트에서 고정 포인트로 바뀐 세 점에 해당되는 샘플 포인트의 좌표값인 정확한 픽셀을 찾아내는 샘플 포인트 계산부와,A sample point calculator for finding an accurate pixel which is a coordinate value of a sample point corresponding to three points changed from a floating point to a fixed point by the preprocessor 상기 샘플 포인트 계산부에서 구해진 샘플 포인트의 좌표값을 연결하는 삼각형의 세 변의 기울기 값을 구하는 기울기 계산부와,A slope calculator for obtaining slope values of three sides of a triangle connecting coordinate values of the sample points obtained by the sample point calculator; 해당 픽셀의 깊이, 색, 투명도 그리고 텍스쳐 매칭을 위한 좌표들의 x축 기준의 증분값과 y축 기준의 증분값을 계산하는 증분값 계산부와,An increment value calculator for calculating increments based on the x-axis and increments based on the y-axis of coordinates for depth, color, transparency, and texture matching of the pixel; 다음 단계의 상기 타일링 트래버설 유닛에서 쓰여질 초기 반-평면 변 함수값을 계산하는 반-평면 변 함수 계산부를 포함하여 구성되는 것을 특징으로 하는 타일링 트래버설 방식의 주사변환 유닛.And a half-plane side function calculator for calculating an initial half-plane side function value to be used in the tiling traversal unit of a next step. 제 3 항에 있어서,The method of claim 3, wherein 상기 증분값 계산부에서의 증분값 계산은Incremental value calculation in the increment value calculation unit , , 식을 이용하여 미리 계산하는 것을 특징으로 하는 타일링 트래버설 방식의 주사변환 유닛. (C는 각 변수들을 총칭함) A tiling traversal scanning conversion unit, which is calculated in advance using an equation. (C generically refers to each variable) 제 1 항에 있어서,The method of claim 1, 상기 타일링-트래버설 유닛은 맨해튼 네이버 방식을 사용하여 스탬프 원점의 반-평면 변 함수 값을 미리 처리하고, 그 값에 해당 증분값을 더하여 나머지 세 점의 값을 구하도록 구성하는 반-평면 함수부와,The tiling-traversal unit is a half-plane function unit configured to preprocess the half-plane side function value of the stamp origin using the Manhattan Naver method, and add the corresponding increment to the value to obtain the values of the remaining three points. Wow, 상기 반-평면 함수부에서 구해진 스탬프의 네 점의 결과를 가지고 현 스탬프가 이동 가능한 원시 방향들을 조사하고, 동시에 저장된 콘텍스트 내용과 타일 경계 및 방향에 대해서 점검하여 최종 이동방향을 결정할 때 사용되어질 각 플래그 비트를 조사하는 스탬프 상태 점검부와,Each flag to be used when determining the final moving direction by examining the raw directions in which the current stamp can move with the result of the four points of the stamp obtained from the anti-planar function, and simultaneously checking the stored context contents and tile boundaries and directions. A stamp status check unit for inspecting bits; 상기 스탬프 상태 점검부의 결과를 토대로 다음에 이동한 최종 방향을 결정하는 최종 방향 결정 및 분기 예측부를 포함하여 구성되는 것을 특징으로 하는 타일링 트래버설 방식의 주사변환 유닛.And a final predictor and a branch predictor configured to determine a final direction to be moved next based on a result of the stamp state checker. 제 5 항에 있어서,The method of claim 5, wherein 상기 분기 예측부는 현재 타일 좌표와 현재 처리중인 스탬프 좌표를 카운트기를 이용하여 매번 조사하여 다음에 수행될 스탬프가 어느 것인지 미리 예측하고, 이 예측 결과로 버퍼에 저장되어 있는 다음에 수행될 그 스탬프 원점 값을 미리 반-평면 변 함수부로 보내는 것을 특징으로 하는 타일링 트래버설 방식의 주사변환 유닛.The branch predictor examines the current tile coordinates and the stamp coordinates currently being processed each time using a counter to predict in advance which stamp is to be performed in advance, and the stamp origin value to be executed next stored in the buffer as a result of the prediction. The transversal scanning unit of the tiling traversal method, characterized in that for transmitting to the half-plane side function in advance.
KR10-2002-0045236A 2002-07-31 2002-07-31 scan conversion unit in tiling-traveresal algorithm KR100487461B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR10-2002-0045236A KR100487461B1 (en) 2002-07-31 2002-07-31 scan conversion unit in tiling-traveresal algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR10-2002-0045236A KR100487461B1 (en) 2002-07-31 2002-07-31 scan conversion unit in tiling-traveresal algorithm

Publications (2)

Publication Number Publication Date
KR20040011920A true KR20040011920A (en) 2004-02-11
KR100487461B1 KR100487461B1 (en) 2005-05-03

Family

ID=37319955

Family Applications (1)

Application Number Title Priority Date Filing Date
KR10-2002-0045236A KR100487461B1 (en) 2002-07-31 2002-07-31 scan conversion unit in tiling-traveresal algorithm

Country Status (1)

Country Link
KR (1) KR100487461B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010137822A3 (en) * 2009-05-28 2011-03-03 주식회사 실리콘아츠 Ray tracing core and ray tracing chip including same

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5446836A (en) * 1992-10-30 1995-08-29 Seiko Epson Corporation Polygon rasterization
KR100269100B1 (en) * 1993-10-30 2000-10-16 윤종용 Rasterizer using triangle traverse
US5598517A (en) * 1995-01-10 1997-01-28 Evans & Sutherland Computer Corp. Computer graphics pixel rendering system with multi-level scanning
US6714196B2 (en) * 2000-08-18 2004-03-30 Hewlett-Packard Development Company L.P Method and apparatus for tiled polygon traversal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010137822A3 (en) * 2009-05-28 2011-03-03 주식회사 실리콘아츠 Ray tracing core and ray tracing chip including same
US9311739B2 (en) 2009-05-28 2016-04-12 Siliconarts, Inc. Ray tracing core and ray tracing chip having the same
US9965889B2 (en) 2009-05-28 2018-05-08 Siliconarts, Inc. Ray tracing core and ray tracing chip having the same

Also Published As

Publication number Publication date
KR100487461B1 (en) 2005-05-03

Similar Documents

Publication Publication Date Title
US11657565B2 (en) Hidden culling in tile-based computer generated images
US8089486B2 (en) Tiled prefetched and cached depth buffer
EP1127337B1 (en) Shading 3-dimensional computer generated images
US6714196B2 (en) Method and apparatus for tiled polygon traversal
KR100510131B1 (en) Pixel cache, 3D graphic accelerator using it, and method therefor
EP1125253B1 (en) Shading 3-dimensional computer generated images
US8682053B2 (en) Method for sampling volume data of an object in an imaging device
US6433782B1 (en) Data processor apparatus and shading apparatus
US20120206455A1 (en) Tile-based graphics system and method of operation of such a system
US20050259100A1 (en) Graphic processing apparatus, graphic processing system, graphic processing method and graphic processing program
US11823324B2 (en) Graphics processing method and system for processing sub-primitives
US5844571A (en) Z buffer bandwidth reductions via split transactions
US8605085B1 (en) System and method for perspective corrected tessellation using parameter space warping
JP4699036B2 (en) Graphics hardware
KR100487461B1 (en) scan conversion unit in tiling-traveresal algorithm
KR100382108B1 (en) 3D graphic accelerator and method for processing graphic acceleration using the same
US7490208B1 (en) Architecture for compact multi-ported register file
US20230105277A1 (en) Circuitry and method
Lee et al. SPARP: a single pass antialiased rasterization processor
US6839060B1 (en) Method and device of consistency buffer for high performance 3D graphic accelerator
SUN ZU1: An Efficient Early Zrange Test Unit
Zagacki et al. Architecture of a 3D Software Stack for Peak Pentium III Processor Performance
KR20220157401A (en) Sampling for partially resident textures
JP2011044077A (en) Image processing device
US20090315906A1 (en) Cache arrangement for graphical applications

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20120426

Year of fee payment: 8

FPAY Annual fee payment

Payment date: 20130418

Year of fee payment: 9

LAPS Lapse due to unpaid annual fee