# US 2010/0164983 A1 · Leveraging graphics processors to optimize rendering 2-d objects

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2010/0164983 A1
- Document ID: US20100164983A1
- Status: Published application
- Kind: A1
- Application number: 12/345,064
- Filed: 2008-12-29
- Published: 2010-07-01
- Earliest claimed: 2008-12-29
- Assignees: Microsoft Corporation
- Inventors: MARK LAWRENCE; ALEXANDER STEVENSON; THOMAS OLSEN; BEN CONSTABLE; ANTHONY HODSDON; CHRIS RAUBACHER; MILES COHEN; BILGEM CAKIR; ROBERT BROWN; BRETT BLOOMQUIST; CHRIS KAM MING CHUI; SAMRACH TUN; JASON HARTMAN; GERHARD SCHNELDER; KANWAL VEDBRAT; ANDREW PRECIOUS; TOM MULCAHY
- Web page: https://patentgrep.com/patent/US20100164983A1

## CPC

- G06T 15/00: Three-dimensional [3D] image rendering
- G06T 11/40: Filling planar surfaces by adding surface attributes, e.g. adding colours or textures
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Methods and computer-readable media for displaying two-dimensional objects on a display device are disclosed. Rendering requests are received from an application to render two-dimensionally modeled graphics to a display device. Primitive geometries of drawing calls of the rendering requests are tessellated into sequences of triangles. The vertices of the triangles are mapped to a vertex buffer along with an index to identify associated constant data. Batching operations store and communicate calls and mapped data to a graphics processing unit by way of a three-dimensional rendering application program interface. Constant data associated with the mapped data are indexed and appended together in a constant buffer, thereby allowing drawing calls to be coalesced. A staging buffer and a staging texture are provided for batching text anti-aliasing operations. Shader fragments are precompiled and organized by way of a predetermined lookup table.

## Claims

### Claim 1

One or more computer-readable media having computer-executable instructions embodied thereon for performing a method of displaying two-dimensional objects on a display device, the method comprising:
receiving a rendering request from an application, wherein said rendering request includes a plurality of drawing calls and a plurality of state setting calls that will be used to draw a two-dimensional drawing that includes a set of primitive geometries (“geometries”), which is made of relatively more complex geometries and relatively less complex geometries, wherein the relatively more complex geometries are relatively more complex than the relatively less complex geometries;
coalescing the plurality of drawing calls and state setting calls in an intermediate buffer associated with a render target;
tessellating the set of primitive geometries into a set of triangles by breaking down at least a portion of the relatively more complex geometries into a sequence of corresponding triangles;
mapping the sequence of corresponding triangles into a vertex buffer, thereby producing mapped data,
wherein the sequence of corresponding triangles are mapped to the vertex buffer as vertices, and
wherein an index is associated with each vertex of said vertices, thereby enabling constant data in a constant buffer to be identified;
indexing said constant data to derived indexed constant data;
storing said indexed data in an indexed constant buffer;
communicating a plurality of calls in the intermediate buffer to a graphics processing unit via a three-dimensional rendering application program interface (“3-D rendering API”); and
processing the plurality of calls in the intermediate buffer using the mapped data and constant buffer, thereby displaying said two-dimensional drawing on said display device.

### Claim 2 (depends on 1)

The computer-readable media of claim 1, wherein a single drawing command operates to render the mapped data.

### Claim 3 (depends on 2)

The computer-readable media of claim 2, wherein a single blend mode and a single input texture are used to render the mapped data.

### Claim 4 (depends on 1)

The computer-readable media of claim 1, wherein a plurality of rendering requests are rendered at a rate of at least 60 frames per second.

### Claim 5 (depends on 1)

The computer-readable media of claim 1, wherein said communication is done in batch.

### Claim 6 (depends on 1)

The computer-readable media of claim 1, wherein the rendering requests are rendered in an immediate mode.

### Claim 7 (depends on 1)

The computer-readable media of claim 1, wherein the mapped data is communicated upon occurrence of one or more of: the vertex buffer is full, a flush command is received, and all data for the rendering requests has been mapped to the vertex buffer.

### Claim 8 (depends on 1)

The computer-readable media of claim 1, wherein the frequency of map and unmap calls to the vertex buffer is reduced.

### Claim 9 (depends on 1)

The computer-readable media of claim 1, further comprising:
querying a computing device for available graphics processing units;
determining that no graphics processing units are available for processing the rendering requests; and
processing the plurality of calls in the intermediate buffer in batch via one or more of a software program and a central processing unit.

### Claim 10 (depends on 1)

The computer-readable media of claim 1, further comprising:
providing one or more shader assemblies to the 3-D rendering API, thereby generating one or more vertex shaders and one or more pixel shaders.

### Claim 11 (depends on 1)

The computer-readable media of claim 1, wherein processing the one or more drawing calls and state setting calls in batch decreases the frequency of render target changes of the 3-D rendering API.

### Claim 12 (depends on 1)

The computer-readable media of claim 1, wherein processing one or more drawing calls and state setting calls from the intermediate buffer decreases an amount of memory access time required to process the rendering requests.

### Claim 13 (depends on 1)

The computer-readable media of claim 1, wherein the batch of one or more drawing calls and state setting calls is not communicated until the occurrence of one or more of: the intermediate buffer is full, a flush command is received, or all rendering requests for rendering at the render target are in the buffer.

### Claim 14 (depends on 1)

The computer-readable media of claim 1, wherein the one or more drawing calls and state setting calls direct rendering to more than one render target, and wherein a different intermediate buffer is associated with each of the more than one render targets, the one or more drawing calls and state setting calls are stored in their respective intermediate buffer, and the contents of each intermediate buffer are communicated separately in batch to the 3-D rendering API.

### Claim 15

One or more computer-readable media having computer-executable instructions embodied thereon for performing a method of displaying two-dimensional objects on a display device, the method comprising:
receiving a plurality of rendering requests from an application, wherein said rendering requests include one or more calls to draw anti-aliased text;
storing the one or more calls in a staging buffer;
providing a staging texture, wherein staging operations for anti-aliasing text are executed at the staging texture;
allocating a rectangular portion of the staging texture to the content of each of the one or more calls;
drawing the content of each of the one or more calls in a respective rectangular portion of the staging texture, wherein the rectangular portions are aligned in one or more rows along an X direction and the one or more rows are offset in a Y direction by the greatest Y extent of the one or more portions in each row;
communicating the staging texture to a parallel queue;
preparing the content of the staging texture in batch by executing one or more staging operations;
communicating one or more blending calls for each of the one or more calls to an intermediate buffer; and
communicating data stored in the intermediate buffer and the parallel queue to a graphics processing unit via a three-dimensional rendering application program interface (“3-D rendering API”), wherein the content of the parallel queue is processed by rendering said content to a render target and blending said content with one or more graphics generated by processing one or more drawing calls in the intermediate buffer, and thereby displaying said two-dimensional drawing on said display device.

### Claim 16 (depends on 15)

The computer-readable media of claim 15, wherein sub-pixel ClearType® text rendering is provided.

### Claim 17

One or more computer-readable media having computer-executable instructions embodied thereon for performing a method of displaying two-dimensional objects on a display device, the method comprising:
receiving a plurality of rendering requests from an application, wherein said rendering requests include a plurality of drawing calls, one or more state setting calls, and one or more text rendering calls that will be used to draw one or more two-dimensional drawings that include a set of primitive geometries (“geometries”), which is made of relatively more complex geometries and relatively less complex geometries, wherein the relatively more complex geometries are relatively more complex than the relatively less complex geometries;
coalescing a plurality of drawing calls and state setting calls in an intermediate buffer associated with a render target;
tessellating the set of primitive geometries into a set of triangles by breaking down at least a portion of the relatively more complex geometries into a sequence of corresponding triangles;
mapping the sequence of corresponding triangles into a vertex buffer, thereby producing mapped data,
wherein the sequence of corresponding triangles are mapped to the vertex buffer as vertices, and
wherein an index is associated with each vertex of said vertices, thereby enabling constant data in a constant buffer to be identified;
indexing said constant data to derived indexed constant data;
storing said indexed data in an indexed constant buffer;
anti-aliasing the content of the plurality of text rendering calls in batch, wherein calls to blend the text are added to the intermediate buffer, and one or more staging textures containing the anti-aliased text are mapped to a parallel queue;
providing one or more shader assemblies to a three-dimensional rendering application program interface (“3-D rendering API”), thereby generating one or more vertex shaders and one or more pixel shaders; and
communicating a plurality of calls in the intermediate buffer to a graphics processing unit (“GPU”) via the 3-D rendering API, wherein the said plurality of calls are processed using the vertex buffer, constant buffer, parallel queue, and one or more vertex shaders and pixel shaders, thereby rendering the said product of two-dimensional rendering requests at said render target.

### Claim 18 (depends on 17)

The computer-readable media of claim 17, further comprising precompiling one or more shader assemblies by:
identifying a plurality of permutations of shader fragments that can be used in the rendering process;
compiling each of the plurality of shader fragments;
compressing the shader fragments; and
storing the shader fragments in a dynamic link library.

### Claim 19 (depends on 17)

The computer-readable media of claim 17, wherein the one or more shader assemblies are referenced by way of a predetermined lookup table.

### Claim 20 (depends on 17)

The computer-readable media of claim 17, wherein the precomputed lookup table is a hash-table.
