Basics GPUs Graphics Reviews

2D performance in reverse? A Comprehensive Analysis | Retro Part 2 of 2

Regardless of how Windows XP, Windows Vista, or Windows 7 handles the GDI, the methodology for programming is actually always the same to begin with. The differences in how this content is processed by the graphics card have already been explained in the previous chapter. But now you will learn how the contents are first created.

Drawing commands

No matter what we would like to output via the GDI in 2D, everything is based on a fixed structure of standardized drawing commands. In detail it would surely go beyond the scope of this article, so just this much: no matter whether lines, curves, polygons, rectangles, ellipses or whatever geometric shape and its properties (filling, line thickness and color, etc.) – there is a precisely defined command for each of these tasks. This is passed to the GDI by the current application program together with the necessary parameters. The respective application then has no influence on the rest.

Direct and buffered drawing: the ant-elephant comparison

In principle, it doesn’t matter whether a million ants each carry a grain of sand 100 m from A to B, or whether the ants carry these grains of sand into a collection container 50 cm away, which is then pulled to its destination by a single elephant. In both processes, the intended target is reached. Now let’s look at the differences. The elephant method is faster, more efficient, and generates less traffic. Coordinating a million ants is much more time-consuming than moving a container once and then dumping it all at once at the destination. It also takes considerably more time. The advantage of the ant method is that you don’t need any other heavy equipment (container = buffer) and that it can even be more efficient and flexible in individual cases, when you only need a few grains of sand. So it always depends on the task and the quantity. Therefore, let us now consider drawing via the GDI to an output device (monitor) in analogy to these examples.

Direktes Zeichnen nach der Ameisen-MethodeDirect drawing according to the ant method: Slow and only optimal in certain cases, because every single object is also drawn individually on the output area, which costs time.

 

Indirektes Zeichnen nach der Elefanten-Methode
Indirect drawing according to the elephant method: A buffer first collects all contents invisibly, the visible output
is done at the end for all objects together and only once.

We can see that as soon as a more complex drawing is to be output, the method using the buffer is much faster. The disadvantage of first needing a so-called device independent bitmap (DIB) for buffering, which has the same size as the visible output area (e.g. full screen or drawing area of a CAD program), is quickly compensated by the speed advantage. On the other hand, it would be idle to rewrite the entire buffer for every small change. Let’s now examine a case in which direct output is a natural choice.

Real-time output when creating and editing drawing objects

If, for example, you want to move a geometric object (e.g. a polygon) from position A to position B on the drawing area in real time using the mouse in a drawing program, then it would make no sense to redraw everything for each of the intermediate positions at which the mouse is currently located, to fill the buffer and then to output it. Here one uses a trick. With the help of the ROP (Raster Operator) one can proceed with XOR (exclusive OR) as follows.

Überlagert man zwei identische Objekte mit XOR, so heben sie sich aufIf you overlay two identical objects with XOR, they cancel each other out. Moving an object by drawing it directly on the output area using the Raster Operator (XOR) is also one of those things:

Verschieben eines Objektes durch direktes Zeichnen auf dem Ausgabebereich mit Hilfe des Raster-Operators (XOR)

You first draw the object to be moved again directly on the output device using XOR at the old location. This makes this object “disappear” on the output surface as if by magic. Now draw the object directly and without XOR to the new position, so that it becomes visible there again. This is repeated with every single mouse movement, so that 10-50 position changes can be displayed within one second. The lazy eye perceives this as a smooth and flowing process without flickering. Only at the end is the buffer completely refilled and output. This method of non-steady, direct drawing on a device is also called “floating drawing”. We will keep this process in mind, because we will have to go into it again in the next section, when we talk about the symptoms in the 2D behavior of the HD5xxx.

Another task is the representation of so-called “floating objects”. By this we mean, for example, all marker points which, depending on the selected processing mode, serve as drawing and orientation aids and whose display, if there are a large number of them, can also become quite problematic. These objects are not a fixed part of the drawing and are not buffered by almost any program.

Inferences:

If we consider what we have just read with the individual flowcharts in the previous chapter, we find that 2D GDI output under XP can be hardware-accelerated and without detours. Under Vista, it almost doesn’t matter whether we use our own buffer or send each command directly to the output device – the entire window is buffered again anyway. Under Windows 7 with WDDM 1.1 drivers, the second buffer is omitted and only the changes are shown. The direct sign is a bit slower than under WDDM 1.0 and struggles with the same causes as under Vista. The additional hardware acceleration for GDI content that is available again is unfortunately very limited. We’ll have to take all this into account when we talk about the benchmark later on and want to evaluate the results properly.

 

Kommentar

Lade neue Kommentare

MechUnit

Mitglied

70 Kommentare 40 Likes

Interessanter Hintergundbericht.

Damals (Windows 1.0-3.00) war eben das Amiga OS aufgrund des Systems mit seinen Co-Prozessoren (für 2D hauptsächlich Blitter) und echten überlappenden Fenstern besser, von der schon damals unerschütterlichen Stabilität einmal abgesehen.

Das Mac OS setzte nochmal einen drauf. Auch da gab es ja fast von Anfang an quasi integrierte Hardwarebschleunigung für 2D-Anwendungen.

Dann gab es ja noch SGI-OS - ein Traum.

Präemptives Multitasking und schnelles, flüssiges Arbeiten war man also hier auf den 3 o.g. Systemen schon gewohnt. Ok, auf A500 & A1000 war aufgrund des langsameren Motorola 68000-Prozessors und 512kb-, bzw. 1 MB Chip-RAM und ohne HDD mit Diskettenzugriff die Lade- und Arbeitsgeschwindigkeit etwas langsamer. Dennoch war das ein besseres Gefühl und komfortabler als noch mit Windows 1.0, geschweige denn DOS - dank Blitter und Copper mit nicht 100 dazwischenfunkenden Treibern und Schnittstellen. Die im System fest integrierte Hardware war eben fest im OS integriert. Angebundene Hardware und deren Treiber wurden "hinten dran" geschoben. Reflections, Video Toaster, Cinema 4D oder Lightwave (die beiden letztgenannten dann schon auf AGA-Maschinen aka A4000, später mit Power PC u.a. in Verbindung mit Silicon Graphics) liefen wie Butter. 2,5D-Layer und deren Beschleunigung spielten da aber auch noch keine Rolle.

Das war aber auch ein Vorteil der damaligen geschlossenen Systeme mit aufs Leib zugeschnittenen Betriebssystemen. Der PC war ja offen und es musste ja schon damals auf unterschiedlichen Systemen das OS möglichst performant und stabil laufen. Damit war (und ist) ein PC nicht nur von der dedizierten, modularen Hardware abhängig, sondern auch über seine Schnittstellen und Treiber. Wenn dann noch die 2D-Unterstützung schlecht oder gar nicht integriert ist (schlimmstenfalls noch auf Hardware-, OS-, Schnittstellen- und Treiberebene) fehlt, ist das für flüssiges Arbeiten im Betriebssystem ein Desaster. Das merkte man sogar später tw. in Windows NT oder 2000 auf professionellen Maschinen. Es stockte halt mal oder es gab "Denkpausen".

Ein gutes Beispiel hierfür waren damals auch Emulatoren. Man merkte direkt, wenn auf Hardwareebene einfach die 2D-Beschleunigung fehlte und die CPU dann mehr schuften musste.

Antwort 2 Likes

Klicke zum Ausklappem
Lagavulin

Veteran

231 Kommentare 187 Likes

Vielen Dank für den interessanten Blick zurück in die 2010er Jahre. Habe ich mit großem Interesse gelesen, weil ich mich damals noch gar nicht mit PC-Technik beschäftigt habe. Spannt man einen zeitlichen Bogen von ATI bis zum 12VHPWR, dann ist Igor‘sLab für mich wirklich so etwas wie „CSI Chemnitz“ im PC-Bereich.

Antwort 1 Like

F
Furda

Urgestein

663 Kommentare 371 Likes

Irgendwo in dieser Zeit da, wohl noch unter WinXP, hatte ich noch einer der letzten Karten von ATI mit AGP Schnittstelle in Betrieb, als der endgültige Wechsel zu PCI vollzogen geworden war.

Der Artikel hat einige Trigger, bin mal auf den 2. Teil gespannt.

Auf alle Fälle, die Einleitung hier birgt für mich schon jetzt das grösste Ausrufezeichen, nämlich, dass man den Finger in die Wunde drücken muss, um eine Änderung/Verbesserung zu erwirken. Damals schon so und heute immer noch brandaktuell. Da hatte ATI offenbar, wie auch alle anderen immer, negativ darauf reagiert, anstatt einsichtig und konstruktiv sein zu wollen. Von ATIs Treiber-Kultur hat wohl bis heute ein Teil bei AMD überlebt.

Antwort 1 Like

Igor Wallossek

1

10,272 Kommentare 19,011 Likes

Das missgünstige Treiber Team firmiert heute immer noch unter ATI in Toronto und es sind die gleichen Leute, die heute alles verdongelt haben, weil sie das MorePowerTool nicht wollen. Das geht schon seit Jahren so :D

Antwort 4 Likes

Derfnam

Urgestein

7,517 Kommentare 2,029 Likes

Toronto Trittchen - guten Feinden gibt man ein Trittchen. Oder 2.
Wobei ich Ati & the Vandalers mit 'Nowhere Toronto' bevorzuge.

Die damaligen Kommentare unter bzw zu den Artikeln läs ich zu gern nochmal.

Antwort Gefällt mir

Derfnam

Urgestein

7,517 Kommentare 2,029 Likes

Alles gut und schön, @Igor Wallossek, aber ich wollte schon ein wenig Wehmut fühlen wegen der alten Köppe.

Antwort Gefällt mir

C
ChaosKopp

Urgestein

559 Kommentare 569 Likes

Ich erinnere mich noch gut an die zugrunde liegenden Artikel und die Emsigkeit, die Du damals ausgelöst hast

Auch wenn die Treiber-Truppe Dich damals hasste, hast Du das Produkt selbst massiv vorangetrieben.

Eigentlich wäre Dankbarkeit angemessen gewesen.

Antwort Gefällt mir

e
eastcoast_pete

Urgestein

1,532 Kommentare 864 Likes

Ja, wenn man darauf hinweist, daß der König nackt dasteht oder der tolle GPU Treiber für die neueste Karte kaum 2D packt, macht man sich schnell unbeliebt. Auch wenn man damit, so wie hier @Igor Wallossek , ATI einen großen Gefallen hattest, denn die Käufer finden solch unterirdische Leistung gar nicht gut. Wie heißt es so schön im Englischen: " No good deed goes unpunished". ATI, anstatt sich zu schämen und für den Hinweis zu danken, wurde ärgerlich und nachtragend.

Antwort Gefällt mir

e
eastcoast_pete

Urgestein

1,532 Kommentare 864 Likes

Der Toaster auf den großen Amigas waren ja aus gutem Grund jahrelang das Kit der Wahl bei frühen CGI Geschichten. SGI Workstations waren klar besser, aber wer hatte schon soviel Geld? Die waren nämlich richtig teuer, für das Geld konnte man schon ein sehr schönes Auto (Oberklasse, keinen Golf 😀) kaufen .

Antwort 1 Like

MechUnit

Mitglied

70 Kommentare 40 Likes

Allerdings - das waren Preise jenseits von gut und böse :D

Antwort 1 Like

e
eastcoast_pete

Urgestein

1,532 Kommentare 864 Likes

Waren (und sind) sehr gute Hintergrund Artikel, danke @Igor Wallossek für das Encore! Und jetzt ein paar Fragen zum Stand der Dinge 2023: wie sieht es denn heutzutage mit Unterstützung von 2D und 2.5D Grafik aus? Sind die iGPUs hier eigentlich immer noch gleichauf (oder besser?) als viele dGPUs, und gibt's hier Unterschiede zwischen Intel iGPUs und den AMD APUs?

Antwort Gefällt mir

Igor Wallossek

1

10,272 Kommentare 19,011 Likes

AMD vor NV und Intel :)

APUs gehen, iGP bei Intel eher meh

Antwort 1 Like

e
eastcoast_pete

Urgestein

1,532 Kommentare 864 Likes

Danke! Auch und gerade wenn man doch einiges machen will, das nach wie vor 2 bzw 2.5D ist; vor allem wenn mehrere UHD Monitore befeuert werden sollen. Interessant, daß AMD aus dem Debakel damals gelernt hat, auch wenn Toronto immer noch schmollt 😁

Antwort 1 Like

P
Postguru

Mitglied

39 Kommentare 7 Likes

Und heute mit einer 6900XT unter Win10
Direct drawing to visible device:
BENCHMARK: DIB-BUFFER AND BLIT

Text: 23245 chars/sec
Line: 28631 lines/sec
Polygon: 12435 polygons/sec
Rectangle: 3229 rects/sec
Arc/Ellipse: 15193 ellipses/sec
Blitting: 14961 operations/sec
Stretching: 1107 operations/sec
Splines/Bézier: 17800 splines/sec
Score: 201

DIB Buffering:
BENCHMARK: DIB-BUFFER AND BLIT

Text: 60096 chars/sec
Line: 151668 lines/sec
Polygon: 631579 polygons/sec
Rectangle: 5491 rects/sec
Arc/Ellipse: 347222 ellipses/sec
Blitting: 58207 operations/sec
Stretching: 7123 operations/sec
Splines/Bézier: 70822 splines/sec
Score: 4510

scheint einiges besser zu laufen .. jedenfalls gepuffert ;)

Antwort Gefällt mir

Igor Wallossek

1

10,272 Kommentare 19,011 Likes

DIB geht direkt in den Speicher, Direct Draw jeder einzelne Pups durch die Renderpipeline.

Antwort Gefällt mir

Danke für die Spende



Du fandest, der Beitrag war interessant und möchtest uns unterstützen? Klasse!

Hier erfährst Du, wie: Hier spenden.

Hier kannst Du per PayPal spenden.

About the author

Igor Wallossek

Editor-in-chief and name-giver of igor'sLAB as the content successor of Tom's Hardware Germany, whose license was returned in June 2019 in order to better meet the qualitative demands of web content and challenges of new media such as YouTube with its own channel.

Computer nerd since 1983, audio freak since 1979 and pretty much open to anything with a plug or battery for over 50 years.

Follow Igor:
YouTube Facebook Instagram Twitter

Werbung

Werbung